what i have:

--> QNAP  TS-121

 

what we need:

- putty     --> a terminal --> every time you see "#" you need putty

- winSCP  --> an "file-explorer" 

 

What we will do:

 

1. installing packages for compiling 

1a) optware IPKG

1b) installing necessary packages for compiling

1c) edit the Optware.sh

 

2. installing missing packages for urbackup

2a) creating temp and install directory

2b) installing missing packages for urbackup

2bb) crypto++

2bbb) libcurl & libcurl-dev

 

3. installing urbackup-server

3a) download the source-code and unzip

3b) we set the "install-dir" with prefix

3c) compiling (make)

3d) edit the MAKEFILE

3e) make install

3f) edit the "start_urbackup_server"

 

4. Testing

4a) starting urbackup-server

4b) test if it works

4c) config the "backup-dir"

 

5. Autostart urbackup-server at startup

5a) create an "autorun.sh"

5b) edit the "qpkg.conf"#

 

---------------------------------------------LET US BEGIN-------------------------------

 

1. installing packages for compiling 

 

1a) optware IPKG

 

-->  go to the app-center on your qnap and install the optware IPKG

--> APP CENTER --> ALL APPS --> optware IPKG

 

 

1b) installing necessary packages for compiling

 

--> for compiling the source code for urbackup we need some packages

     --> logon with putty on your nas and type the following:

 

# ipkg update

# ipkg install libidn getopt unzip optware-devel

 

1c) edit the Optware.sh

 

Fix the $PATH in “/etc/profile” (see here)

--> you can edit the Optware.sh with winSCP --> go to /etc/init.d/ and open the Optware.sh

Look for the section of code which mentions /opt/bin. Replace it so that this part of the file looks like:

 

# adding Ipkg apps into system path ...
/bin/cat /etc/profile | /bin/grep "PATH" | /bin/grep "/opt/bin" 1>>/dev/null 2>>/dev/null
# Bug fix for following: put IPKG first, per http://forum.qnap.com/viewtopic.php?f=124&t=15663
# was [ $? -ne 0 ] && /bin/echo "export PATH=$PATH":/opt/bin:/opt/sbin >> /etc/profile
[ $? -ne 0 ] && /bin/echo "export PATH=/opt/bin:/opt/sbin:\$PATH" >> /etc/profile

save the file. 

reboot the QNAP NAS and check – in admin shell (putty) – the $PATH environment : variable “ /opt/bin” and “/opt/sbin” should come before “/bin” and “/usr/bin”. For instance: 

 # echo $PATH
/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/sbin

 

2. installing missing packages for urbackup

 

2a) creating temp and install directory

 

--> in the temp dir i will download the necessary source-code for compiling

--> Because my Qnap (121) has not enough space at "system-dir" i will use my "own" install dir for urbackup

--> the temp and install dir are now FIX!!! if you want anothe location for the temp and install dir you have  adapt every time where you find my temp and install dir @ your own 

 

temp dir:

with winSCP go to 

     /share/HDA_DATA/

create a temp dir 

 

install dir:

with winSCP got to 

     /share/HDA_DATA/

create urbackup dir 

in urbackup dir create an install dir and an backup dir

 

it shuld look like this:

   /share/HDA_DATA/

                              temp

                              urbackup

                                             install

                                             backups

 

 

2b) installing missing packages for urbackup

 

--> for compiling the source-code of urbackup successful we need some package 

--> the crypto++ package need do be compiled and installed

 

 

2bb) crypto++

 

with putty type the following:

# cd /share/HDA_DATA/temp

# mkdir cryptopp

# cd cryptopp

 

download the source-code for crypto++

# wget http://prdownloads.sourceforge.net/cryptopp/cryptopp562.zip

# unzip cryptopp562.zip

# rm -r cryptopp562.zip

# make -f GNUmakefile --> this will take a wile

# make libcryptopp.a libcryptopp.so

# make install

--> if there comes an error message, with cryptest.exe (not enough space) --> thats no problem

--> now you can delete the cryptopp folder in your temp

# rm -r /share/HDA_DATA/temp/cryptopp

 

2bbb) libcurl & libcurl-dev

 

# ipkg update

# ipkg install libcurl

# ipkg install libcurl-dev automake

REBOOT the system now

# reboot

 

 

3. installing urbackup-server

 

3a) download the source-code and unzip

 

--> with putty go to the temp dir

# cd /share/HDA_DATA/temp

 

download the source-code for urbackup

 

# wget http://sourceforge.net/projects/urbackup/files/Server/1.2.3/urbackup-server-1.2.3.tar.gz/download

# tar xzf urbackup-server-1.2.3.tar.gz

# rm urbackup-server-1.2.3.tar.gz

# cd urbackup-server-1.2.3.261/

 

3b) we set the "install-dir" with prefix

 

----------------------PREFIX----------------

--> we use the prefix to install urbackup on a place we want

--> because at my qnap is not enough space @ the "system directory"

--> this will install urbackup @ /share/HDA_DATA/urbackup/install/

--> the following command will check your qnap if all dependings are installed

 

# ./configure --prefix /share/HDA_DATA/urbackup/install/

 

--> when there was NO ERROR-MESSAGE then we can compile the source-code

 

3c) compiling (make)

--> this will take a very long time--> go for lunch or coffe

# make

 

3d) edit the MAKEFILE

 

--> we have to edit the make file, because the "adduser" command will not work

--> go with winSCP to

/share/HDA_DATA/temp/urbackup-server-1.2.3.261/

and edit the MAKEFILE

--> go to the buttom and search for the following line:

adduser urbackup --system --quiet --group --home "$(DESTDIR)$(localstatedir)/urbackup" || true

--> and comment it out with #, so that it look like this:

###adduser urbackup --system --quiet --group --home "$(DESTDIR)$(localstatedir)/urbackup" || true

 

 

 

3e) make install

 

--> now we can "install" urbackup  @ QNAP

--> All files shoud be installe @ /share/HDA_DATA/urbackup/install/

 

# make install

 

3f) edit the "start_urbackup_server"

 

--> go with winSCP to  

                               /share/HDA_DATA/urbackup/install/sbin/ 

 

--> edit the "start_urbackup_server" 

   
search for: 

      PREFIX=/usr

 

replace with:

 

   PREFIX=/share/HDA_DATA/urbackup/install

search for: 

 

      DAEMON_DIR="/var"

 

replace with:

 

   DAEMON_DIR="/share/HDA_DATA/urbackup/install/var"

 

SAVE FILE!!!!

 

 

 

4. Testing

 

4a) starting urbackup-server

 

with putty go to the install dir

# cd /share/HDA_DATA/urbackup/install/sbin

# ./start_urbackup_server

 

 

4b) test if it works

 

---> open your browser and type:

IP_of_Your_NAS:55414

 

--> now you should see the webAdminPagePage

 

 

4c) config the "backup-dir"

 

--> under Settung you should set the location where urbackup-server should save the "BACKUPS"

--> i set: /share/HDA_DATA/urbackup/backups/

 

5. Autostart urbackup-server at startup

 

5a) create an "autorun.sh"

--> REMEMBER to adapt these lines if you use another location of your "install path"

-->  I make some "variables" --> there you can place your "install path"

 

--> with winSCP go to:

                    /share/HDA_DATA/urbackup/install/sbin

--> create the file:

                    autorun.sh

--> enter the following line into the "autorun.sh" file

THE RED CODE should only be ONE!!!! LINE

 

############################################

 

#!/bin/sh
  
PIDFILE="/var/run/urbackup_srv.pid"
LOGFILE="/var/log/urbackup.log"
HTTP_PORT=55414
FASTCGI_PORT=55413
INSTALL_DIR="/share/HDA_DATA/urbackup/install"
LIB_DIR="$INSTALL_DIR/lib"
start()
{
## go to the /var dir --> this is neccessary if you start urbackup_srv
cd /share/HDA_DATA/urbackup/install/var
## start the urbackp_srv with plugins
  /share/HDA_DATA/urbackup/install/sbin/urbackup_srv --daemon --http_port $HTTP_PORT --logfile $LOGFILE --pidfile $PIDFILE --plugin $LIB_DIR/liburbackupserver_urlplugin.so --plugin $LIB_DIR/liburbackupserver_cryptoplugin.so --plugin $LIB_DIR/liburbackupserver_downloadplugin.so --plugin $LIB_DIR/liburbackupserver_fsimageplugin.so --plugin $LIB_DIR/liburbackupserver_httpserver.so --plugin $LIB_DIR/liburbackupserver.so --http_root $INSTALL_DIR/var/urbackup/www --workingdir $INSTALL_DIR/var --user urbackup --snapshot_helper $INSTALL_DIR/bin/urbackup_snapshot_helper
}
  
stop()
{
   #echo "Shutting down "
   kill `cat $PIDFILE`
   rm -f $PIDFILE
   sleep 5
}
  
# you do not need to edit this lines
case "$1" in
      start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        # Restarting the Daemon
        $0 stop
        $0 start
    ;;
    
  *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
esac
exit 0

 



5b) edit the "qpkg.conf"

 

--> with winSCP goto

     /etc/config/

--> edit the "qpkg.conf

--> the SHELL and the INSTALL_PATH are the important lines

--> at the end of the line enter these following lines!! REMEMBER to adapt these lines if you use anothe location of your "install path"

 

 

[urbackup]
Name = urbackup
Version = 0.1
Author = escctrl
Date = 2013-20-08
Shell = /share/HDA_DATA/urbackup/install/sbin/autorun.sh       
Install_Path = /share/HDA_DATA/urbackup/install/sbin
Enable = TRUE

 

 

-->FINISH<---