BackupPC-users

Re: [BackupPC-users] Local backups

2009-03-23 11:34:00
Subject: Re: [BackupPC-users] Local backups
From: Adam Goryachev <mailinglists AT websitemanagers.com DOT au>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Tue, 24 Mar 2009 02:28:20 +1100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Dugas wrote:
> On Sun, 2009-03-22 at 22:34 -0700, Craig Barratt wrote:
>> Paul writes:
>>
>>> I tried just changing 'RsyncClientCmd' to "$rsyncPath $argList+" but it
>>> seems BackupPC is expecting the SSH and is now improperly escaping
>>> 'RsyncArgs'.  The hitch is with a space in one.
>>>
>>> $Conf{RsyncClientCmd} = '$rsyncPath $argList+';
>>> $Conf{RsyncArgs} = [
>>>   '--numeric-ids',
>>>   '--perms',
>>>   '--owner',
>>>   '--group',
>>>   '-D',
>>>   '--links',
>>>   '--hard-links',
>>>   '--times',
>>>   '--block-size=2048',
>>>   '--recursive',
>>>   '--filter',
>>>   'dir-merge /.backuppc-filter'
>>> ];
>>>
>>> The last two are an addition I use to allow users to exclude files from
>>> the backup with properly crafted .backuppc-filter files in their
>>> directories.
>>>
>>> I end up with an extra slash after the dir-merge.
>>>
>>> /usr/bin/rsync --server --sender --numeric-ids --perms --owner --group
>>> -D --links --hard-links --times --block-size=2048 --recursive --filter
>>> dir-merge\ /.backuppc-filter --ignore-times . /etc/
>> The "\" is to escape the following " " since it is a single argument.
>>
>> Actually, BackupPC doesn't execute the command as printed.  Rather,
>> it keeps the arguments as an array and passes them directly to exec().
>> So rsync should see a single argument
>>
>>     dir-merge /.backuppc-filter
>>
>> right after '--filter'.
>>
>> For logging purposes, the command is turned into a single string and
>> escaped as though it was going to be executed by a shell (although it
>> isn't). That's when the "\" gets added.
>>
> 
> So I just tried it again to make sure I got the error message correct.
> Here's what I'm getting:
> 
>   full backup started for directory /etc (baseline backup #50)
>   Running: /usr/bin/rsync --server --sender --numeric-ids --perms --owner 
> --group -D --links --hard-links --times --block-size=2048 --recursive 
> --filter dir-merge\\\ /.backuppc-filter --ignore-times . /etc/
>   Xfer PIDs are now 24521
>   Got remote protocol 1852534357
>   Fatal error (bad version): Unknown filter rule: `dir-merge\ 
> /.backuppc-filter'
> 
> Maybe what I'm seeing is not caused by the escaping?
> 

Silly question perhaps, but why not just use tar ?? you probably need to
use sudo anyway as well, so perhaps you could just modify your ssh to
call sudo instead....

Regards,
Adam
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknHqo4ACgkQGyoxogrTyiVgfQCgt/MLv0Y9zpp+lNObJdXOrm8C
3ioAnAxZYWVWTx3btqf7hROSEeWwsLKM
=hHlW
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
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/

<Prev in Thread] Current Thread [Next in Thread>