NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
datamgmt
Jul 21, 2008Aspirant
Backup ReadyNas to ReadyNas with rsync and exclude lists
Hi, I have two ReadyNas that are successfully doing backups (between two sites) via rsync. There is one directory that we do not wish to copy over because it contains large, temporary media files (...
gdietz
Jun 24, 2009Aspirant
Thank you so much for this code update. I was looking into it and considering using it as a roadmap - but I kept thinking the lack of the settings being visible to the UI would be problematic to someone other than me looking at the interface. I then looked at the config files and considered that maybe there is even a slightly better way to do this vs having a separate config file.
The /etc/cron.d/frontview-backup file for rsync contains lines that look like...
5 19-19/24 * * sun,mon,tue,wed,thu,fri,sat root /frontview/bin/backup 001 enable 'remote!!rsync!!192.168.1.10::folder!!!!!!' 'local!!backup!!serverx-backup/folder!!!!!!' 'FIRST_TIME!!0!!1!!1!!0' &> /dev/null
Ultimately the "192.168.1.10::folder" variable gets put into $backup_source_path which is then used on 1 of 2 lines similar to...
${password_param} $nice rsync -aA${rsync_option} '${login_param}$backup_source_path/.' '$dest_path' &> \${TEMP_COPYLOG}
It seems it would be possible to use the web-ui "Path" field to quietly embed the command line options. e.g. "folder --exclude blah --delete" - these would make it into the backup file as "!!192.168.1.10::folder%20--exclude%20blah%20--delete!!"
Someone more familiar with perl string parsing could then split the path at the first "--" and auto append the options to the rsync options and remove it from the path...(excuse the pseudo code - I know zero perl)...
if $backup_source_path contains "--" then
$rsync_option += [ everything in $backup_source_path starting after the first -- ]
$backup_source_path = [ everything to the left of the first -- in $backup_source_path ]
end if
The same could be done with the dest path as well. So without requiring separate config files you could override options and see the overrides in the UI. Obviously there are some issues with this - possibly some special characters that can't be saved using the UI (e.g. I would have suggested a "folder[--exclude blah --delete]" syntax except that the [ ( { characters are not allowed by the UI and I am assumming that the path doesn't have a "--" in it.
It could also be extended to have something like "folder --exclude blah --delete_" where the the "_" at the end of the parameters signifies that rather than $rsync_option += it should be a complete override of the options.
I would happily do this myself and post it to the site if I was even remotely competent in Perl - I am hoping that this model makes sense to someone who knows perl and they may want to take a swing at it.
The /etc/cron.d/frontview-backup file for rsync contains lines that look like...
5 19-19/24 * * sun,mon,tue,wed,thu,fri,sat root /frontview/bin/backup 001 enable 'remote!!rsync!!192.168.1.10::folder!!!!!!' 'local!!backup!!serverx-backup/folder!!!!!!' 'FIRST_TIME!!0!!1!!1!!0' &> /dev/null
Ultimately the "192.168.1.10::folder" variable gets put into $backup_source_path which is then used on 1 of 2 lines similar to...
${password_param} $nice rsync -aA${rsync_option} '${login_param}$backup_source_path/.' '$dest_path' &> \${TEMP_COPYLOG}
It seems it would be possible to use the web-ui "Path" field to quietly embed the command line options. e.g. "folder --exclude blah --delete" - these would make it into the backup file as "!!192.168.1.10::folder%20--exclude%20blah%20--delete!!"
Someone more familiar with perl string parsing could then split the path at the first "--" and auto append the options to the rsync options and remove it from the path...(excuse the pseudo code - I know zero perl)...
if $backup_source_path contains "--" then
$rsync_option += [ everything in $backup_source_path starting after the first -- ]
$backup_source_path = [ everything to the left of the first -- in $backup_source_path ]
end if
The same could be done with the dest path as well. So without requiring separate config files you could override options and see the overrides in the UI. Obviously there are some issues with this - possibly some special characters that can't be saved using the UI (e.g. I would have suggested a "folder[--exclude blah --delete]" syntax except that the [ ( { characters are not allowed by the UI and I am assumming that the path doesn't have a "--" in it.
It could also be extended to have something like "folder --exclude blah --delete_" where the the "_" at the end of the parameters signifies that rather than $rsync_option += it should be a complete override of the options.
I would happily do this myself and post it to the site if I was even remotely competent in Perl - I am hoping that this model makes sense to someone who knows perl and they may want to take a swing at it.
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!