Posted by: Ian | June 20, 2010

Install Crashplan on a Qnap Atom (TS-x59)

This guide is a modified version of the original by Cokeman.dk as there are some bits that didn’t quite work.

How to install and enable CrashPlan on the QNAP nas (Atom models)

Install: Opware (qpkg, from qnap homepage)

From an SSH run this:

ipkg update
ipkg install nano
ipkg install cpio
ipkg install bash
ipkg install coreutils
cd /opt
ln -s /opt/bin/bash /bin/bash
wget http://download.crashplan.com/installs/linux/install/CrashPlan/CrashPlan_2010-03-08_Linux.tgz
tar zfx CrashPlan_2010-03-08_Linux.tgz
rm CrashPlan_2010-03-08_Linux.tgz
cd /opt/CrashPlan-install

Edit the install.sh (I use the command “nano install.sh“)

#!/opt/bin/bash
BINSLOC=”/bin /opt/bin /usr/bin /usr/local/bin”

Install Crashplan (command is: “./install.sh”) using “admin” user and into “/opt/crashplan”

Getting it to start on reboot

edit /etc/config/qpkg.conf, and add: (I use the command “nano /etc/config/qpkg.conf”)

[CrashPlanStarter]
Name = CrashPlanStarter
Version = 0.1
Enable = FALSE
QPKG_File =
Date = 2009-12-06
Shell = /share/MD0_DATA/.qpkg/crashplan/cprun.sh
Install_Path = /share/MD0_DATA/.qpkg/crashplan
Author = Cokeman.dk

now we must create the “/share/MD0_DATA/.qpkg/crashplan/cprun.sh”:

mkdir /share/MD0_DATA/.qpkg/crashplan

use your favorite scp program to transfer the cprun.sh, attached to the guide. into “/share/MD0_DATA/.qpkg/crashplan”

Last but not at least, run the command:

chmod +x /share/MD0_DATA/.qpkg/crashplan/cprun.sh

In addition edit /opt/qpkg/crashplan/bin/CrashPlanEngine and add the line:

#!/opt/bin/bash
BINSLOC=”/bin /opt/bin /usr/bin /usr/local/bin”

To start crashplan use the webadmin of the QNAP, to start the QPKG, that we have just made.

or you can start crastplan manualy to test if it works. (It will not start on reboot, there you must enable it using the webadmin)

cd /opt/crashplan/bin

ln -s /opt/bin/bash /bin/bash

./crashplan start

Here is the cprun.sh file – Note I’ve modified the sleep intervals.

#!/bin/sh
RETVAL=0
QPKG_NAME=”CrashPlanStarter”
_exit()
{
/bin/echo -e “Error: $*”
/bin/echo
exit 1
}
# Determine BASE installation location according to smb.conf
BASE=
publicdir=`/sbin/getcfg Public path -f /etc/config/smb.conf`
if [ ! -z $publicdir ] && [ -d $publicdir ];then
publicdirp1=`/bin/echo $publicdir | /bin/cut -d “/” -f 2`
publicdirp2=`/bin/echo $publicdir | /bin/cut -d “/” -f 3`
publicdirp3=`/bin/echo $publicdir | /bin/cut -d “/” -f 4`
if [ ! -z $publicdirp1 ] && [ ! -z $publicdirp2 ] && [ ! -z $publicdirp3 ]; then
[ -d “/${publicdirp1}/${publicdirp2}/Public” ] && BASE=”/${publicdirp1}/${publicdirp2}”
fi
fi
# Determine BASE installation location by checking where the Public folder is.
if [ -z $BASE ]; then
for datadirtest in /share/HDA_DATA /share/HDB_DATA /share/HDC_DATA /share/HDD_DATA /share/MD0_DATA; do
[ -d $datadirtest/Public ] && BASE=”/${publicdirp1}/${publicdirp2}”
done
fi
if [ -z $BASE ] ; then
echo “The Public share not found.”
_exit 1
fi
QPKG_DIR=${BASE}/.qpkg/crashplan
case “$1” in
start)
if [ `/sbin/getcfg ${QPKG_NAME} Enable -u -d FALSE -f /etc/config/qpkg.conf` = UNKNOWN ]; then
/sbin/setcfg ${QPKG_NAME} Enable TRUE -f /etc/config/qpkg.conf
elif [ `/sbin/getcfg ${QPKG_NAME} Enable -u -d FALSE -f /etc/config/qpkg.conf` != TRUE ]; then
_exit  “${QPKG_NAME} is disabled.”
fi
/bin/echo “Enable CrashPlanStarter”
echo 1048576 > /proc/sys/fs/inotify/max_user_watches
/bin/sleep 30
source /etc/profile
/bin/sleep 60
mkdir /var/lib/crashplan
cp /share/MD0_DATA/.qpkg/crashplan/.identity /var/lib/crashplan/
#    #sleep 120
/opt/crashplan/bin/crashplan start
;;
stop)
/bin/echo “Disable CrashPlanStarter”
/opt/crashplan/bin/crashplan stop
cp /var/lib/crashplan/.identity /share/MD0_DATA/.qpkg/crashplan/
;;
restart)
$0 stop
$0 start
;;
*)
echo “Usage: $0 {start|stop|restart}”
exit 1
esac
exit $RETVAL

One final thing is after starting and setting up crashplan as you want run the following command to save the identity for CrashPlan:

cp /var/lib/crashplan/.identity /share/MD0_DATA/.qpkg/crashplan/

Now it should work after a restart 🙂

Advertisements

Responses

  1. This site was a lot better back in the day =p

  2. Got it up and running perfectly on a QNAP TS-509, but after running non stop for 2 month the NAS was rebooted. Now it doesn’t backup anymore. Service can be stopped/started from the webinterface, but no backup is registered anywhere,,

  3. I followed these directions, and they worked to a tee! The only problem is, crashplan is starting but i cannot connect to it. I did a netstat -a and 4243 and 4242 are not on there and not listening. I have setup headless clients on other QNAP Nas’s before but using the home version not the pro version. Also, when i run IP tables, it causes a problem, an error and doesn’t work.

    I need to get this working for a client ASAP. Any ideas?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Categories

%d bloggers like this: