Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

install URbackup in a jail

dasti

FreeNAS Aware
Joined
Jun 11, 2014
Messages
63
Thanks
22
#1
last update 8 Oct 2015
last tested with URbackup 1.4.9 on FreeNAS-9.3-STABLE-201509282017



Initially I wrote this guide because the developer compiled a PBI for version 1.3.2, but it doesn't work for me at that time (check the original thread for more details). Actually it's not that true any more the .pbi works you can stop the pluging via the jail section of the UI but in the pluging UI it keeps saying that the status is OFF...you can DL it from here.



What is URbackup ?
- It's an open source client/server backup solution made by URONI with interesting features :

- full and incremental image and file backups: Whole partitions can be saved as well as single directories.
- Image and file backups while the system is running
- centralized web interface administration that can control or not client's configuration
- Secure and efficient backups to your own server via Internet, if the client is currently not in your local network
- more details here -> http://www.urbackup.org/
- If you think is it a good software, please support Uroni's project.


What are we going to do ?
- create a jail and prepare it
- install urbackup
- configure the backup directory



step 0 - preparation

- your FreeNAS must have a fully working internet connection
- you must be able to access your freenas box through SSH
- you must prepare the IP address you'll allocate to the jail we're going to create together
- you must have a dataset that will be dedicated to the data storage (if not I'll explain this later) it will be named "backups"

- your pool is named "mypool"
- the jail "urbackup"


step 1 - Create a jail

If you're not familiar with the concept of jails please check the freenas 9.3 official documentation and the freebsd handbook.

With freenas' web interface, create a standard FreeBSD Jail x64 with the name Urbackup and the [IP address of your choice]

autostart remained checked
VIMAGE - unchecked
NAT - unchecked
vanilla - checked

step 2 - connect to your FreeNAS box with ssh

from linux
- open a shell and type ssh [YourUserName]@[IpAddressOfYourFreenasBox]

Code:
ssh root@192.168.4.10


from windows
- download and install your favorite ssh client software (example superputty)
- use your client to connect to your FreeNAS box



step 3 - enter your jail

(so you'll be able to enter commands directly from inside the jail)
check how many jails you have and note the number of the jail id (JID) of the Urbackup's jail
Code:
jls

you'll get a list of the jail looking like this

[root@freenas] ~# jls
JID IP Address Hostname Path
1 192.168.4.1 poney /mnt/testzfs/jails/poney
2 192.168.4.2 Urbackup /mnt/testzfs/jails/Urbackup

now you have the JID (or jail's IDentification) you can enter the jail with a command of this format -> jexec [JID] tcsh

Code:
jexec 2 tcsh

the prompt should look like something like this

root@Urbackup:/ #

note that it's possible to connect directly in ssh into the jail. (instruction to do that are in the official freenas documentation)



step 4 - install needed packages
Code:
pkg update
pkg upgrade
pkg install nano
pkg install wget
pkg install cryptopp
pkg install curl



step 5 - download and unpack urbackup
Code:
mkdir /urbackup
cd /urbackup
wget http://hndl.urbackup.org/Server/1.4.9/urbackup-server-1.4.9.tar.gz --no-check-certificate

note :that this url can change (as I'm writing those words, it move from source forge to hndl

unpack urbackup

Code:
cd /urbackup
tar zxvf urbackup-server-1.4.9.tar.gz



step 6 - install urbackup

Thoses steps can take a "certain amount of time"
Code:
cd urbackup-server-1.4.9
./configure
make
make install




step 7 - autostart URbackup at boot


build the initializing script, edit this file
Code:
nano -wc /etc/rc.d/urbackup_srv


There is a discussion bellow about were the startup file should be placed according to the freebsd standards /usr/local/etc/rc.d/urbackup_srv or /etc/rc.d/urbackup_srv ...It seems it should be the first one but it works for me in the 2nd one, if anyone has reading suggestions

Insert this text and save
Code:
#!/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"

Check if there's no line brake in the 6th line ( "command arg" ), pay attention when you copy/paste it
Give the execute permissions to the script
Code:
chmod +x /etc/rc.d/urbackup_srv

add a line in the startup file
Code:
echo 'urbackup_srv_enable="YES"' >> /etc/rc.conf



step 8 - create a dataset and mount it into the jail

It's a good practice to separate where you store your datas and where you store you application. In freenas' terms one dataset for the jail, one for the storage. The jail dataset was already created, we'll use another for the data and mount it into the jail.

Make sure that you have a dataset ready for those data. If not, go in Freenas webUI in storage / volumes / mypool / create dataset and create it ! Check the official documentation for more detailled informations.


To mount your data's dataset in the jail use Freenas' webUI, go in jails / deluge / storage / Add storage and input the correct source and destinations directories. Check the official documentation for more detailed informations


here's the example in our case


source : /mnt/mypool/backups
destination : /mnt/mypool/jails/urbackup/mnt/backups
create directory is : checked
mounted is : checked

change permissions
Code:
chown -R urbackup:urbackup /mnt/backups


step 9 - correct Urbackup's default configuration


Connect to URbackup's web interface with your favorite internet browser using an url of this format -> http://[IpaddressOfTheJail]:55414

Go in the settings / general / server tab

In the [backup storage path] field, the default value is "c:/backup", change it into "/mnt/backups"


Credits

The original post is here, so I'm not the author just the secretary :).
Thanks to cheeks, dabone, dimi, peterjs, protoSD and RAurelian the real authors !
 
Last edited:
Joined
Mar 25, 2012
Messages
19,154
Thanks
1,850
#2
I'm not at home so I can't test it, but this seems to be very thorough and well written. I'll move it to the guides section!
 

RAurelian

FreeNAS Aware
Joined
Jan 29, 2014
Messages
37
Thanks
15
#3
Nice Job Dasti for putting this guide together. I am now running UrBackup in a FreeNAS Jail for a few months and it`s working great and am very happy with the choice. I really do not know if there is a simpler way to centrally automate creation of backup system images and files. I have different settings for each of my servers, different settings for Client PCs, and they all back up according to their schedule. Moreover, you can disable users from making their own changes to to the backup client agent, so no one interferes.

Also, did I mention I am very happy with the performance? My environment:
FreeNAS 9.2.1.6 is running on a Supermicro server with 24 HDD bays, supermicro MB and Intel(R) Xeon(R) CPU E3-1270 v3 @ 3.50GHz CPU. I have 2x 1Gbit NICs in LAGG, 32GB DDR3-1600MHz CAS9 ECC. For now we only have 6 of the 24 HDD bays populated and the HDD are not much: 6x 3TB SAS 7.2K rpm (so not the fastest), but more will come in the future.

My servers and most PCs have 1Gbit LAN connections and when UrBackup is taking a image of a server, the transfer (upload, from server to FreeNAS) works at above 800 Mbit/sec constantly and I can also upload to FreeNAS from other servers and PCs and still get speeds above 300 - 500 Mbit/sec for a connection (depending on what I transfer, large or many smaller files) during the backup. Download from FreeNAS to any workstation / server on the LAN almost always works at full Gbit speed (for large files) for a single connection during the backup. I was afraid that the HDDs running at only 7200 rpm would be too slow for Gbit LAN (we needed large, cheap storage at first), but as I see it 2x Gbit NICs in LAGG are pretty much saturated, so we will get a 10 Gbit NIC soon for the FreeNAS box and one for the ESXi box where the servers are running and and see how that works out. If the HDDs will be holding us down, we will get faster ones in the future.

I have LZ4 compression enabled on all datasets, but on those where backups and large files are stored, I used GZIP-9 compression and everything seems to work in real-time with no delay - and I never see the CPU going above ~ 10 - 25% just for transfers. The dataset with the UrBackup jail has a quota of 1 TB, and is currently holding 1.3 TB of backups, which actually use ~ 800 GB on the FreeNAS dataset (GZIP-9).

We also use FreeNAS jails for hosting our website, a bug tracker and a few other web-based databases and tools, so with FreeNAS we really got more than we bargained for, but for anyone looking for backing up things on FreeNAS, I believe UrBackup should be a default feature!
 

cen

Newbie
Joined
Jul 12, 2014
Messages
27
Thanks
0
#4
I would like to suggest a few improvements to this tutorial.

1. You can use ports tree to install curl /ports/ftp/curlpp no need for package manager
2. There is no need to install nano and wget, just use ee and fetch
3. The error when creating the user is due to group not existing. Simply run pw groupadd urbackup before that
4. You must chown -R urbackup:urbackup /backups after creating the /backups

Anyway.. this tool seems better than backula to me because backula has no free windows binaries. Any idea how hard would it be to make a working PBI for this or even make an official plugin for FreeNAS?
 

dasti

FreeNAS Aware
Joined
Jun 11, 2014
Messages
63
Thanks
22
#5
Hi Cen,

thanks for your comments !

1. You can use ports tree to install curl /ports/ftp/curlpp no need for package manager
2. There is no need to install nano and wget, just use ee and fetch
well, hum, to be honest you reached the limits of my knowledge just after "tree" :)
For now, I barely understands the differences between those different packaging methods, and to be honest, even if I'm sure there's a good reason to that, I even don't understand why bother having 2 ways of doing the same thing.
If your way is better, feel free to give me the commands (and maybe some explanation that can't hurt ) and I'll do my best to include it in the guide.

3. The error when creating the user is due to group not existing. Simply run pw groupadd urbackup before that
4. You must chown -R urbackup:urbackup /backups after creating the /backups
I'm going to try this and I'll update the guide

Any idea how hard would it be to make a working PBI for this or even make an official plugin for FreeNAS?
A pbi already exists here but it doesn't start. Again I tried to have a look on what's wrong but doing this guide was easier for me :)

Anyway.. this tool seems better than backula to me because backula has no free windows binaries.
You nailed a point here, I recently discovered that a lot's of projects pretends to be open source but actually the most interesting or I could say the only interesting feature is closed source and/or subject to license fees
- the groupwares where the "connector" for mobile (android/ios) have to be payed...
- the digital signage where the player for android device (the best choice in term of functions/price) has to be paid (xibo)
- the monitoring solution that goes wild in the paid versions (nagios)
If there's a company behind the solution, providing professionnal support, services, consulting, hosting.. seems much more credible to me.


That said, my goal is to use freenas as a backup server :
- for workstations (in windows of course),
- with a centralized administration
- it should be as fast and cheap as possible so logically the solution should be installed directly on freeNAS

Here's a quick list of what I looked at with a non exhaustive features list

Bacula
- the freenas plugin doesn't start- it's not an open source project : the windows client is licensed

Amanda backup :
- same problem as bacula, the windows client licensed

deltacopy
+ basically rsync for windows (can be configured in client or server mode)
+ can be used with the rsync jobs of freeNAS
- no real centralized gui where you can check if a backup turn good or bad ...etc...

Create synchronicity :
+ can use cifs shares
+ gui easy to configure from a end user
+- works only on windows
+- file incremental backup but on file level
- no central configuration/control

BackupPC
(was my 1rst choice)
+ incremental backup on file level uses cifs share
+ incremental backup on block level using rsync if it's installed
+ compression before file copy
+ strong centralized user interface
+ file level deduplication
+ according to me researchs it should work on freebsd but I could not make it work :/

URbackup
+ total drive image backup
+ centralized web gui (still I don't know how many clients it can hande...)
+ file level deduplication
+- incremental backups on file level
- active project but only one guy behind it
 
Last edited:
Joined
Jul 1, 2014
Messages
3
Thanks
0
#6
Just a little update on what I noticed when I just installed this on my 9.2.1.18 setup.

First, I updated the pkg-ng:
Code:
    # pkg install ports-mgmt/pkg
    # pkg update -f
    # pkg check -Ba
    # pkg upgrade


Next, I installed the packages and just used the cryptopp package instead of compiling. Was there a reason to not use the pkg?
Code:
    # pkg install ftp/wget
    # pkg install security/cryptopp
    # pkg install ftp/curl


On my system, the urbackup user and group were both created properly during the configure & make process. Maybe this was something that was fixed in the 1.4.2 version of UrBackup, since your guide was based off of 1.3.2. Also, when using wget, I had to add the --no-check-certificate option to the command.
Code:
wget https://sourceforge.net/projects/urbackup/files/Server/1.4.2/urbackup-server-1.4.2.tar.gz/download --no-check-certificate


Once I attached some storage from a dataset to /mnt/backups, I did change the permissions as cen stated:
Code:
    # chown -R urbackup:urbackup /mnt/backups


Other than that, great guide and thanks for putting it together!
 

dasti

FreeNAS Aware
Joined
Jun 11, 2014
Messages
63
Thanks
22
#7
thanks a lot for your remarks, it will definitively improve that guide and also my poor level in frenas/freebsd by the way ;-)


First, I updated the pkg-ng:
Code:
    # pkg install ports-mgmt/pkg
    # pkg update -f
    # pkg check -Ba
    # pkg upgrade
nice, you answered to that pkg upgrade stuff !! -> updated

Next, I installed the packages and just used the cryptopp package instead of compiling. Was there a reason to not use the pkg?
on reason to that, I just compiled information from previous posts -> updated

On my system, the urbackup user and group were both created properly during the configure & make process. Maybe this was something that was fixed in the 1.4.2 version of UrBackup, since your guide was based off of 1.3.2.
I confirm -> updated

Also, when using wget, I had to add the --no-check-certificate option to the command.
Code:
wget https://sourceforge.net/projects/urbackup/files/Server/1.4.2/urbackup-server-1.4.2.tar.gz/download --no-check-certificate
-> updated

Once I attached some storage from a dataset to /mnt/backups, I did change the permissions as cen stated:
Code:
    # chown -R urbackup:urbackup /mnt/backups
-> Updated

I have a question, in my case I store the backups in the URbackup jail which relies on it's own dataset.
If I guess correctly, you use a dataset that is "external" to the jail and you mount it in the jail ? Am I right ?
 
Joined
Sep 13, 2014
Messages
5
Thanks
0
#8
I assume that this would be a lot better / more space efficient than running UrBackup on a windows host attached to the Freenas via iscsi? Or is there any negative points in running it in a jail?
 
Joined
Nov 4, 2014
Messages
4
Thanks
0
#9
Hey guys, I am a FN Noob but was trying to get this installed and ran into an issue trying to access the web page post install. Is there a reboot required or somehow a way to start the service ??
 

dasti

FreeNAS Aware
Joined
Jun 11, 2014
Messages
63
Thanks
22
#10
I assume that this would be a lot better / more space efficient than running UrBackup on a windows host attached to the Freenas via iscsi? Or is there any negative points in running it in a jail?
I'm not sure I understand your question correctly.
My question to RobD68 is about method of storing the backup files in the same dataset as the jail or in another dataset.

For now I think that my method can be improved, putting the data in another dataset could make the upgrade phase of urbackup easier :)
 

dasti

FreeNAS Aware
Joined
Jun 11, 2014
Messages
63
Thanks
22
#11
Hey guys, I am a FN Noob but was trying to get this installed and ran into an issue trying to access the web page post install. Is there a reboot required or somehow a way to start the service ??
you can stop/start the jail in freenas' graphical interface
or try this
Code:
service urbackup_srv start
 
Joined
Nov 4, 2014
Messages
4
Thanks
0
#12
Thanks for the reply. I stopped the jail and restarted it with no luck in getting to the web page. I then ran the command you suggested and got the following error...I am stumped on this one.


[root@freenas] ~# service urbackup_srv start
urbackup_srv does not exist in /etc/rc.d or the local startup
directories (/etc/ix.rc.d /usr/local/etc/rc.d)
 

dasti

FreeNAS Aware
Joined
Jun 11, 2014
Messages
63
Thanks
22
#13
Thanks for the reply. I stopped the jail and restarted it with no luck in getting to the web page. I then ran the command you suggested and got the following error...I am stumped on this one.


[root@freenas] ~# service urbackup_srv start
urbackup_srv does not exist in /etc/rc.d or the local startup
directories (/etc/ix.rc.d /usr/local/etc/rc.d)
as I anderstand it, it seems that you skipped step 7 of the guide

more information on this subject
https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-rcd.html
https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-starting-services.html
 
Joined
Nov 4, 2014
Messages
4
Thanks
0
#14
I created the file urbackup_srv in /etc/rc.d

Here is what I have:

#!/bin/sh
. /etc/rc.subrname=urbackup_srv
rcvar=urbackup_srv_enable
command="/usr/local/sbin/${name}"command_args="--plugin /usr/local/lib/liburbac$ (This line got cut off)
start_precmd="cd /usr/local/var"
load_rc_config $name
run_rc_command "$1"


The command statement got cut off but what I did was brought the remainder of the commands separated by a space on the same line. Is this right ?
 

dasti

FreeNAS Aware
Joined
Jun 11, 2014
Messages
63
Thanks
22
#15
it's not correct
you did copy line 6 (command args ....) and line 5 (command=/usr/local ... ) together, this is 2 separate lines.

Code:
command="/usr/local/sbin/${name}"

Code:
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"
 
Last edited:
Joined
Sep 13, 2014
Messages
5
Thanks
0
#16
I'm not sure I understand your question correctly.
My question to RobD68 is about method of storing the backup files in the same dataset as the jail or in another dataset.

For now I think that my method can be improved, putting the data in another dataset could make the upgrade phase of urbackup easier :)
Sorry I should have been more clear. I meant there seems to be a lot of extra space taken up when using iscsi due to metadata and the fact that it is block storage so freenas isn't aware of what the host OS (windows in my case) is doing in the volume. I was thinking that this would solve all those issues seeing as the data is now being stored at a file level in the native freenas filesystem.

Another question. If i create an external dataset and share it with the jail, would I also be able to share that dataset on my network via nfs?
 

hervon

FreeNAS Experienced
Joined
Apr 23, 2012
Messages
208
Thanks
41
#18
Amen to all of you who made it possible. dasti you here me ? ;-)

I installed UrBackup with very few hiccups. I'm amazed with this open source gem! Martin Raiber really did a great job. At first, the Restore CD 1.1 did not see my network. Eventually found version 1.1.1 that did the trick. Tried a full backup and restore (to a spare HD). So far so good.

Next on my to do list : update server to 1.4.6

BTW, I found a neat tool to boot multiple ISOs with a USB flash drive : Easy2boot. Just drop any ISO in the MAIN MENU and bam!
 
Top