Monday, July 28, 2014

URBackup on FreeNAS

Ok, so I decided to create a cheap backup server.  Bought 4 - 3TB hard drives on Amazon.  Installed in a workstation that I already had.  Set it up in the server room.

The FreeNAS install process is really simple so I won't go into detail about that.  The URBackup install was somewhat easy as well, but I want to detail that here for anyone who wants to recreate.

Install FreeNAS and reboot.  Connect and set a root password.
http://doc.freenas.org/index.php/Quick_Start_Guide

I followed the instructions in this manual which is perfect.  I didn't have to adjust any of the steps, but for help to others I will outline the same steps here.  http://forums.freenas.org/index.php?threads/urbackup-installation-guide.22117/

Create a Jail
-Jails
-Add Jails
Urbackup
Standard
(fill in default gateway)
uncheck VIMAGE
-OK

Connect to FreeNAS via SSH (must be enabled in services)

Find the number of the jail you created above.
#jls
#jexec 1 tcsh

This enters you into the jail itself.  All commands from now on are specific to the jail itself and should not be run on the FreeNAS system.

#pkg install
#pkg install update
#pkg install nano wget
#portsnap fetch extract
#cd /usr/ports/security/cryptopp
#make CXXFLAGS="-fPIC" (accept all default questions and pop up boxes)
#make install
#pkg install curl

#cd /
#mkdir /urbackup
#cd /urbackup
#wget (download link for latest urbackup tar.gz source)

#tar zxvf urbackup*.tar.gz
#cd urbackup-server-x.y.z
#./configure
#make
#make install

(I had trouble with the install.  It said it was completed, but I had to run the command again to actually get it to install the program into the right folders.)

#adduser urbackup --system --quiet --group --home "/usr/local/var/urbackup" || true
(this is supposed to create the account, but it just brought up the account dialog for me, so I filled it in by hand)
urbackup
urbackup
empty
empty
empty
empty
empty
/usr/local/var/urbackup
empty
no
no
yes
no

#nano /etc/rc.d/urbackup_srv

Paste the below into the file:
#!/bin/sh
. /etc/rc.subr
name=urbackup_srv
rcvar=urbackup_srv_enable
command="/usr/local/sbin/$(name)"
command_args="--plugin /usr/local/lib/liburbackupserver_urlplugin.so --plugin /usr/local/lib/liburbackupserver_cryptoplugin.so --plugin /usr/local/lib/liburbackupserver_downloadplugin.so --plugin /usr/local/lib/liburbackupserver_fsimageplugin.so --plugin /usr/local/lib/liburbackupserver_httpserver.so --plugin /usr/local/lib/liburbackupserver.so --http_root /usr/local/var/urbackup/www --workingdir /usr/local/var --user urbackup --http_port 55414 --logfile /var/log/urbackup_srv.log --daemon"
start_precmd="cd /usr/local/var"
load_rc_config $name
run_rc_command "$1"

The command args line should be one complete line.

#chmod +x /etc/rc.d/urbackup_srv

#nano /etc/rc.conf

Add this line to the end:
urbackup_srv_enable="YES"

#mkdir /backups
#chown -R urbackup:urbackup /backups

#/etc/rc.d/urbackup_srv start

Access the web interface at http://[ipaddress]:55414
Go to Settings / General / Server
Adjust the [Backup Storage Path] from the default to /backups

#/etc/rc.d/urbackup_srv restart

From FreeNAS web click on the Jails -> Urbackup -> Storage -> Add Storage and connect the /backups folder with the FreeNAS volume created.  I want all of the storage space available to the backup jail, so I connected it straight.

Next is the client on the servers, for sending files to URBackup.  More on that process in another post.

1 comment:

  1. Hi, thank you very much for the fine description. I succeeded in the install and the system seems to be running. When I do a full file backup I can see the files in the backup folder. But after a while the incremental backup starts and my files are deleted from the backup folder. Have you seen anything similar?

    ReplyDelete