Thanks that put me on the right path - I read the documentation but I am not that familiar with Perl arrays
I just had to take an "s" off the exclude option (not the array name)
my %options = ( 'archive' => 1,
'verbose' => 0,
'dry-run' => 0,
'delete' => 1,
'exclude' => \@excludes,
'rsh' => "/usr/bin/ssh");
Main Topics
Browse All Topics





by: kawasPosted on 2009-08-03 at 18:10:10ID: 25009833
from the documentation for FILE::RSYNC
The exclude option needs an array reference as its value, since there cannot be duplicate keys in a hash. There is an equivalent include option. Only an exclude or include option should be used, not both. Use the '+ ' or '- ' prefix trick to put includes in an exclude array, or to put excludes in an include array (see rsync(1) for details). Include/exclude options form an ordered list.
so do something like:
my @excludes;
push @excludes, "Channels/";
my %options = ( 'archive' => 1,
'verbose' => 0,
'dry-run' => 0,
'delete' => 1,
'excludes' => \@excludes,
'rsh' => "/usr/bin/ssh");