BackupPC-users

Re: [BackupPC-users] Arguments for --filter don't get proper escaping

2009-01-29 05:46:05
Subject: Re: [BackupPC-users] Arguments for --filter don't get proper escaping
From: Holger Parplies <wbppc AT parplies DOT de>
To: Thomas Karcher <thkarcher AT gmx DOT de>, Juergen Harms <Juergen.Harms AT unige DOT ch>
Date: Thu, 29 Jan 2009 11:44:25 +0100
Hi,

Juergen Harms wrote on 2009-01-29 10:41:22 +0100 [Re: [BackupPC-users] 
Arguments for --filter don't get proper escaping]:
> Thomas Karcher wrote on 2009-01-29 09:59:51 +0100 [[BackupPC-users] Arguments 
> for --filter don't get proper escaping]:
> > 
> > I'm thrilled of this just discovered feature of rsync: --filter
> > 
> > Now I want to use it in BackupPC, so I added this to $Conf{RsyncArgs}:
> > 
> > '--filter=:- /nobackup.txt'
> > 
> > My problem is that there seems to be something wrong with the escaping
> > of the space ...
> 
> A nice workaround to this backslashing problem is to place your filter 
> statements into a file - say /home/user/rsync_filters - and add a 
> corresponding statement to your arguments:
>       --filter=.\ /home/user/.usync/filters

hey, great idea - except that it doesn't solve anything. In what way, do you
suppose, is your space character different from the one above (other than
being escaped, making things worse)? On a side note, your argument does not
match the file you are suggesting.

> If you later want to add additional filter statements to your 
> command-line, your command line will probably blow up even if you become 
> a backslash acrobat, a filter file makes things much easier

That part is true. Just keep in mind that you then have a part of your backup
configuration that is not stored with the rest of the BackupPC configuration,
but rather on the backup client somewhere.

> > I observed that with an rsyncd as backup partner,
> > everything seems to work fine, but with a command line rsync, it's odd:
> > 
> > Running: /usr/bin/sudo /usr/bin/rsync --server --sender --numeric-ids
> > --perms --owner --group -D --links --hard-links --times
> > --block-size=2048 --recursive --checksum-seed=32761 --one-file-system
> > --filter=:-\\\ /nobackup.txt . /
> > 
> > Adding backslashes or quotes just worsens the situation and I get even
> > more escaping backslashes ... any ideas?

Actually, you need to use '$argList' instead of '$argList+' in
$Conf{RsyncClientCmd} (and $Conf{RsyncClientRestoreCmd}). You are not passing
the arguments through a shell (as you are when using 'ssh'), so you don't want
any escaping. That also means you should remove the backslash you apparently
have in there now - contrary to your statement above. The entry in RsyncArgs
should read '--filter=:- /nobackup.txt'. It is passed as one argument to
'sudo', which will pass it on as one argument to 'rsync', I believe. Quite
disappointing to backslash acrobats, really.

Regards,
Holger

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/