--> 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:
Code: Select all
# ipkg update
# ipkg install libidn getopt unzip optware-devel
1c) edit the Optware.sh
Fix the $PATH in “/etc/profile”
--> you can edit the Optware.sh with winSCP --> go to
and open the/etc/init.d/
Look for the section of code which mentionsOptware.sh
Replace it so that this part of the file looks like:/opt/bin.
Code: Select all
# 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
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:
Code: Select all
# 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
create a/share/HDA_DATA/
install dir:temp dir
with winSCP got to
create/share/HDA_DATA/
in urbackup dir create an install dir and an backup dirurbackup 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:
Code: Select all
# cd /share/HDA_DATA/temp
# mkdir cryptopp
# cd cryptopp
Code: Select all
# wget http://prdownloads.sourceforge.net/cryptopp/cryptopp562.zip
# unzip cryptopp562.zip
# rm -r cryptopp562.zip
# make -f GNUmakefile
# make libcryptopp.a libcryptopp.so
# make install
--> now you can delete the cryptopp folder in your temp
Code: Select all
# rm -r /share/HDA_DATA/temp/cryptopp
2bbb) libcurl & libcurl-dev
Code: Select all
# ipkg update
# ipkg install libcurl
# ipkg install libcurl-dev automake
Code: Select all
# reboot
3. installing urbackup-server
3a) download the source-code and unzip
--> with putty go to the temp dir
Code: Select all
# cd /share/HDA_DATA/temp
Code: Select all
# 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/
----------------------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
Code: Select all
# ./configure --prefix /share/HDA_DATA/urbackup/install/
3c) compiling (make)
--> this will take a very long time--> go for lunch or coffe
Code: Select all
# make
--> we have to edit the make file, because the "adduser" command will not work
--> go with winSCP to
and edit the/share/HDA_DATA/temp/urbackup-server-1.2.3.261/
--> go to the buttom and search for the following line:MAKEFILE
Code: Select all
adduser urbackup --system --quiet --group --home "$(DESTDIR)$(localstatedir)/urbackup" || true
Code: Select all
###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/
Code: Select all
# make install
3f) edit the "start_urbackup_server"
--> go with winSCP to
--> edit the/share/HDA_DATA/urbackup/install/sbin/
"start_urbackup_server"
search for:
Code: Select all
PREFIX=/usr
Code: Select all
PREFIX=/share/HDA_DATA/urbackup/install
Code: Select all
DAEMON_DIR="/var"
Code: Select all
DAEMON_DIR="/share/HDA_DATA/urbackup/install/var"
4. Testing
4a) starting urbackup-server
with putty go to the install dir
Code: Select all
# cd /share/HDA_DATA/urbackup/install/sbin
# ./start_urbackup_server
4b) test if it works
---> open your browser and type:
--> now you should see the webAdminPagePageIP_of_Your_NAS:55414
4c) config the "backup-dir"
--> under Settung you should set the location where urbackup-server should save the "BACKUPS"
--> i set:
5. Autostart urbackup-server at startup/share/HDA_DATA/urbackup/backups/
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:
--> create the file:/share/HDA_DATA/urbackup/install/sbin
--> enter the following line into the "autorun.sh" fileautorun.sh
Code: Select all
#!/bin/sh
[color=#008000]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"[/color]
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
executable --> press"autorun.sh"
and set the permission toF9
0755
5b) edit the "qpkg.conf"
--> with winSCP goto
--> edit the/etc/config/
--> the SHELL and the INSTALL_PATH are the important lines"qpkg.conf"
--> at the end of the line enter these following lines!! REMEMBER to adapt these lines if you use anothe location of your "install path"
Code: Select all
[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<---