From: Raman G. <roc...@fa...> - 2008-02-11 06:58:45
|
Raman Gupta wrote: > Another thing that would be useful (with or without the change above) > is if the RsyncArgs had the runtime variable substitution turned on > for at least the ConfDir and the host name. For example, I tried this: > > $Conf{RsyncArgs} = [ > [...], > '--exclude-from=$confDir/pc/$host.exclude', > ]; > > but it did not work. I went trolling around the source and I think this patch accomplishes the variable substitution in RsyncArgs: --- Rsync.pm.orig 2008-02-11 01:09:27.000000000 -0500 +++ Rsync.pm 2008-02-11 01:54:05.000000000 -0500 @@ -246,6 +246,18 @@ # transferred, even though it is a full dump. # $rsyncArgs = $conf->{RsyncArgs}; + + # + # Merge variables into $rsyncArgs + # + my $args = { + host => $t->{host}, + hostIP => $t->{hostIP}, + client => $t->{client}, + confDir => $conf->{ConfDir} + }; + $rsyncArgs = $bpc->cmdVarSubstitute($rsyncArgs, $args); + $rsyncArgs = [@$rsyncArgs, @fileList] if ( @fileList ); $rsyncArgs = [@$rsyncArgs, "--ignore-times"] if ( $t->{type} eq "full" ); Cheers, Raman Gupta |