BackupPC-users

Re: [BackupPC-users] Backing up localhost nfs share with rsync

2011-07-21 10:49:49
Subject: Re: [BackupPC-users] Backing up localhost nfs share with rsync
From: Holger Parplies <wbppc AT parplies DOT de>
To: Ghislain <gadnet AT aqueos DOT com>
Date: Thu, 21 Jul 2011 16:46:35 +0200
Hi,

Ghislain wrote on 2011-07-21 13:38:22 +0200 [[BackupPC-users] Backing up 
localhost nfs share with rsync]:
> [...]
> ----------------------------------------backupserver.mydomain.com.pl--------------------------------------------
> # include default config
> do '/etc/backuppc/config.pl';

unrelated to your problem, but this is pointless. The global config is
included anyway. You can use 'do ...' to include a config for a group of hosts
(e.g. "do '/etc/backuppc/all_my_servers.pl';"), but for the global config this
is meaningless.

> #
> # Path to rsync executable on the client
> #
> $Conf{RsyncClientPath} = '/usr/bin/sudo -n /usr/bin/rsync';

This is wrong, as you see in the error message. The RsyncClientPath is
/usr/bin/rsync. The sudo comes into the game in RsyncClientCmd.
As a side note, the '-n' option to sudo is sort of pointless. You need to
configure sudo correctly. '-n' just makes it fail in a perhaps more obvious
way. Adding the '-n' is sort of saying "I'm expressly preparing for this to be
wrong". Use it for debugging, but then remove it (well, my opinion).

> [...]
> # rsync client commands
> $Conf{RsyncClientCmd}           = '$rsyncPath $argList+';

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

Note that I removed the '+'. sudo does *not* add an additional shell level, so
you don't want extra quoting.

> $Conf{RsyncClientRestoreCmd}    = '$rsyncPath $argList+';

Same here. Add 'sudo', remove '+'.

> $Conf{BackupFilesExclude} = {
>         '/'     =>      [ '**/archive/**' ],
> };

If you're excluding the directory 'archive', you're implicitly excluding
everything beneath it. Do you *want* the directory itself (without content)?
Using '**/archive/' should otherwise be equivalent (and if you *do* want the
directory itself, '**/archive/*' should be sufficient).

>   have the error  "/Fatal error (bad version): Exec failed for 
> /usr/bin/sudo -n /usr/bin/rsync/..." :
> [...]
> full backup started for directory / (baseline backup #8)
> started full dump, share=/
> Running: /usr/bin/sudo\ -n\ /usr/bin/rsync --server --sender 
> --numeric-ids --perms --owner --group -D --links --hard-links --times 
> --recursive --checksum-seed=32761 --protocol=28 --ignore-times . /

You likely don't have a command 'sudo -n /usr/bin/rsync' in /usr/bin, or
rather, you probably don't have a directory 'sudo -n ' in /usr/bin, which
in turn contains 'rsync' within subdirectories 'usr/bin'.

The incorrect escaping is due to the fact that you specified RsyncClientPath
incorrectly above.

Apart from that, everything looks good.

Hope that helps.

Regards,
Holger

------------------------------------------------------------------------------
5 Ways to Improve & Secure Unified Communications
Unified Communications promises greater efficiencies for business. UC can 
improve internal communications as well as offer faster, more efficient ways
to interact with customers and streamline customer service. Learn more!
http://www.accelacomm.com/jaw/sfnl/114/51426253/
_______________________________________________
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/