How do I backup my jail without including /mnt storage mapping?

Status
Not open for further replies.

strawdog74

Dabbler
Joined
May 23, 2012
Messages
42
I am trying to backup /mnt/hdd2 to another freenas installation using the built in rsync modules, performing a "pull" from the backup machine.

The trouble is that when I try to backup the jail folder, it is recursively backing up ALL the data mapped to storage in /jail/freebsd/mnt of the jail. This is causing these files to be backed up twice (the mapping points to links on the same volume)

I am using the following "include-from=Files.txt" :-

Code:
+ apps
+ apps/**
+ documents
+ documents/**
+ jail
+ jail/**
- *


I've tried adding "- /jail/freebsd/mnt" but that didn't work. Do I need to add a wildcard to the end of it or something? Also, does anyone have a good reference for help on rsync include-from/exclude-from processing?

edit-words
 

alexg

Contributor
Joined
Nov 29, 2013
Messages
197
I would like to know the answer to this as well.
 

strawdog74

Dabbler
Joined
May 23, 2012
Messages
42
I've figured it out, and have been running some performance metrics before posting an update to the thread. Basically, when selecting files/folders, you need to be aware of the following :-

rsync will include or exclude depending on the first qualifying entry.

So, to backup my freebsd jail, I create a file on /root called "include.txt" and populate it as follows (note when ADDING nested folders you need a separate + for each directory level) :-

Code:
- jail/freebsd/mnt/**
+ jail
+ jail/freebsd
+ jail/freebsd/**
- *


This should result in the freebsd jail being backed up without the mount points. Also, for testing, you can use the following command to avoid waiting for the rsync task to trigger.

Code:
# Pull from Backup Server :-
rsync -avvxzHAX 192.168.1.50::hdd2 /mnt/bkup/jail --include-from="include.txt" --log-file="rsync.log"
 
Where :-
FreeNAS IP = 192.168.1.50
Rsync Module = hdd2


Further reading
Full system backup with rsync - ArchWiki
 

IrishGodfather

Dabbler
Joined
Jul 14, 2014
Messages
17
This is really the best solution? I stay consistent and keep all of my jails storage under /Jails/*appname*/mnt Don't claim to be an rsync expert but thinking there should be a way to exclude anything with the variable /Jails/*appname*/mnt

*appname* meaning the specific jail application name.
 
Status
Not open for further replies.
Top