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
I appreciate your desire to keep patching to a minimum, although the solution I suggested doesn't change in any substantial way from yours. Both involve patching a single file /frontview/bin/backup in the exact same place in the code. (see my solution below).
The only difference in your solution and the one that I just tried is who you determine what rsync options to append. Your solution uses the $backup_source/dest_path variable to lookup up in a separate config file. Mine uses the variables themselves to see if they have options embedded in them and if so parses them out.
This solution allows you to enter the options directly into the UI (with no changes to the UI code) - just put all your options at the end of the path field using <sp>--optionx -optiony valuey.... The backup code will detect the " --" in the path and remove them - placing them into the options variable.
The advantage of this is that you can modify and see the options in the UI viewer, you can disable SSH access after patching the backup script, and you don't need to maintain a separate config file.
I suspect it is just a matter of personal preference and as you say I hope that netgear adds advanced options into the UI. Thank you again for doing the heavy lifting on figuring out where to do the changes.
-- backup.orig
++ backup
if( $backup_option_rsync_remove_missing_source_files )
{
$rsync_option .= " --delete";
}
if( $backup_option_rsync_use_compression )
{
$rsync_option .= " --compress";
}
+if ($backup_source_share_proto eq 'rsync' && $backup_source_path =~ /^.*?\s--/)
+{
+ @parts = split(/\s--/, $backup_source_path);
+ $backup_source_path = shift(@parts);
+ foreach $option (@parts) { $rsync_option .= " --$option" }
+}
+if ($backup_dest_share_proto eq 'rsync' && $backup_dest_path =~ /^.*?\s--/)
+{
+ @parts = split(/\s--/, $backup_dest_path);
+ $backup_dest_path = shift(@parts);
+ foreach $option (@parts) { $rsync_option .= " --$option" }
+}
The only difference in your solution and the one that I just tried is who you determine what rsync options to append. Your solution uses the $backup_source/dest_path variable to lookup up in a separate config file. Mine uses the variables themselves to see if they have options embedded in them and if so parses them out.
This solution allows you to enter the options directly into the UI (with no changes to the UI code) - just put all your options at the end of the path field using <sp>--optionx -optiony valuey.... The backup code will detect the " --" in the path and remove them - placing them into the options variable.
The advantage of this is that you can modify and see the options in the UI viewer, you can disable SSH access after patching the backup script, and you don't need to maintain a separate config file.
I suspect it is just a matter of personal preference and as you say I hope that netgear adds advanced options into the UI. Thank you again for doing the heavy lifting on figuring out where to do the changes.
-- backup.orig
++ backup
if( $backup_option_rsync_remove_missing_source_files )
{
$rsync_option .= " --delete";
}
if( $backup_option_rsync_use_compression )
{
$rsync_option .= " --compress";
}
+if ($backup_source_share_proto eq 'rsync' && $backup_source_path =~ /^.*?\s--/)
+{
+ @parts = split(/\s--/, $backup_source_path);
+ $backup_source_path = shift(@parts);
+ foreach $option (@parts) { $rsync_option .= " --$option" }
+}
+if ($backup_dest_share_proto eq 'rsync' && $backup_dest_path =~ /^.*?\s--/)
+{
+ @parts = split(/\s--/, $backup_dest_path);
+ $backup_dest_path = shift(@parts);
+ foreach $option (@parts) { $rsync_option .= " --$option" }
+}
Related Content
NETGEAR Academy

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