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 (...
ianmacd
Oct 03, 2008Aspirant
Here's an improved version of my patch. Previously, the extra rsync options would only be used if the back-up source was an rsync server. The new version will also use the options when the back-up destination is an rsync server.
Let's suppose your /frontview/conf/rsync.conf file looks like this:
The first line is the configuration for the job described in my last posting.
The second line shows a new job, that backs up a local ReadyNAS share to a USB-attached hard drive. The job could also be configured as a simple share back-up, but that wouldn't allow files that have since been removed from the source to also be removed from the destination. Only rsync jobs allow this (the --delete flag), so we have to use that, even though both source and destination are actually local.
The --size-only flag is often needed when the source and destination file-systems aren't the same time. If copying from Linux ext3 to Windows FAT, for example, there will be discrepancies in the timestamps that cause all files to be copied from the source to the destination, defeating the main purpose of rsync. --size-only tells rsync to use only the size of the file to determine whether or not the file has changed on the source.
Let's suppose your /frontview/conf/rsync.conf file looks like this:
foo.caliban.org::slash/var/named!!--exclude chroot/proc --delete-excluded
127.0.0.1::USB_HDD_1/backup!!--size-only
The first line is the configuration for the job described in my last posting.
The second line shows a new job, that backs up a local ReadyNAS share to a USB-attached hard drive. The job could also be configured as a simple share back-up, but that wouldn't allow files that have since been removed from the source to also be removed from the destination. Only rsync jobs allow this (the --delete flag), so we have to use that, even though both source and destination are actually local.
The --size-only flag is often needed when the source and destination file-systems aren't the same time. If copying from Linux ext3 to Windows FAT, for example, there will be discrepancies in the timestamps that cause all files to be copied from the source to the destination, defeating the main purpose of rsync. --size-only tells rsync to use only the size of the file to determine whether or not the file has changed on the source.
--- backup.orig 2008-09-25 15:56:13.000000000 +0200
+++ backup 2008-10-04 00:43:28.000000000 +0200
@@ -244,6 +244,29 @@
$rsync_option .= " --delete";
}
+my $rsync_option_file = '/frontview/conf/rsync.conf';
+if( -f $rsync_option_file && ( $backup_source_share_proto eq 'rsync' ||
+ $backup_dest_share_proto eq 'rsync' ) )
+{
+ open(RSYNC, $rsync_option_file);
+ my @rsync = <RSYNC>;
+ close(RSYNC);
+
+ my $row = (grep(/$backup_source_path/, @rsync))[0];
+
+ unless( $row )
+ {
+ $row = (grep(/$backup_dest_path/, @rsync))[0];
+ }
+
+ if( $row )
+ {
+ my ($extra_options) = (split $FS, $row)[1];
+ chomp($extra_options);
+ $rsync_option .= " $extra_options";
+ }
+}
+
my $mount_point = "/job_${job}";
my $login_param;
my $source_path = "/$backup_source_share_proto/$backup_source_path";
Related Content
NETGEAR Academy

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