BackupPC-users

Re: [BackupPC-users] Local backups

2009-03-23 13:38:37
Subject: Re: [BackupPC-users] Local backups
From: Paul Dugas <Paul AT dugas DOT cc>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Mon, 23 Mar 2009 13:32:58 -0400
On Tue, 2009-03-24 at 02:28 +1100, Adam Goryachev wrote:
> -----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....

I prefer to change as little as I can when I'm not too smart on the
internals of something so I was just looking to take the ssh overhead
out of the picture.  Removing the + fixed the escaping problem and, as
you suggest, I had to use sudo as well.

For those who may be interested in the same approach, I'm backing up to
and from SAN volumes (GFS/LVM/AoE) that are mounted on the backup host.

  $Conf{RsyncClientCmd} = '/usr/bin/sudo $rsyncPath $argList';
  $Conf{RsyncClientRestoreCmd} = '/usr/bin/sudo $rsyncPath $argList';

sudoers has 

  backuppc ALL=NOPASSWD:/bin/gtar,/bin/tar,/usr/bin/rsync

Cheers,

Paul
-- 
Paul Dugas - paul AT dugas DOT cc - 404.932.1355

Attachment: signature.asc
Description: This is a digitally signed message part

------------------------------------------------------------------------------
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>