Re: [BackupPC-users] RsyncArgs configuration

2008-02-10 Thread Raman Gupta
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.0 -0500
+++ Rsync.pm2008-02-11 01:54:05.0 -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 = [EMAIL PROTECTED], @fileList] if ( @fileList );
 $rsyncArgs = [EMAIL PROTECTED], --ignore-times]
 if ( $t-{type} eq full );


Cheers,
Raman Gupta

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


[BackupPC-users] RsyncArgs configuration

2008-02-10 Thread Raman Gupta
I am setting up BackupPC to backup several machines on my home
network. I am converting over from rlbackup, which has served me well
for a couple of years, but BackupPC should be even better. Kudos to
the developers. I do have a couple of nits however...

I find the file include/exclude mechanism in BackupPC (via
$Conf{BackupFilesExclude}) for rsync to be somewhat obtuse. There
doesn't seem to be any easy way to create advanced include/exclude
lists with exceptions, as one can using the --exclude-from and
--include-from arguments to rsync.

Therefore, I have modified the $Conf{RsyncArgs} to add an
--exclude-from parameter, with a path to an external exclude file.
This works fine. But I would like to set this on a per-host basis. To
do this, I need to override all the rsync args including the Do not
edit these! parameters, instead of just my single exclude-from parameter.

Since that is not the ideal situation, I think it would be useful if
backuppc came with the Do not edit these! rsync parameters separate
from the other rsync arguments. Something like:

$Conf{RsyncBaseArgs} = [
#
# Do not edit these!
#
'--numeric-ids',
'--perms',
'--owner',
'--group',
'-D',
'--links',
'--hard-links',
'--times',
'--block-size=2048',
'--recursive',

#
# Rsync = 2.6.3 supports the --checksum-seed option
# which allows rsync checksum caching on the server.
# Uncomment this to enable rsync checksum caching if
# you have a recent client rsync version and you want
# to enable checksum caching.
#
#'--checksum-seed=32761',
];


$Conf{RsyncArgs} = [
#
# Add additional arguments here
#
'--exclude-from=/etc/BackupPC/rsync.exclude',
];

This would allow users to easily override just the relevant
additional arguments for rsync on a per-host basis.

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.

Cheers,
Raman Gupta

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/