BackupPC-users

Re: [BackupPC-users] BackupPC v4 and rsync for localhost

2017-06-15 23:14:25
Subject: Re: [BackupPC-users] BackupPC v4 and rsync for localhost
From: Craig Barratt via BackupPC-users <backuppc-users AT lists.sourceforge DOT net>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Thu, 15 Jun 2017 20:13:33 -0700
You can set $Conf{RsyncSshArgs} to a command that simply executes its arguments (like ssh does).  However, rsync adds the host name to whatever you specify in $Conf{RsyncSshArgs}, so unfortunately this doesn't work since the first argument is the host name, and env will give an error:

$Conf{RsyncSshArgs} = ['-e', '/usr/bin/env'];    # <- this doesn't work

A very bad hack would be to use something like this:

$Conf{RsyncSshArgs} = ['-e', '/usr/bin/sudo -p'];

(sudo has to be passwordless from the BackupPC user.)  The -p (prompt) option expects an argument to set the password prompt (which is not used).  So it consumes the host name argument appended by rsync, then runs the rest of the command like ssh does.  Bingo - the client rsync gets run locally, with elevated privileges from sudo, without ssh.

An alternative would be to write a short shell/python/perl script instead that does it more cleanly - shifts the first argument off argv, and execs the rest.

From Paul:

where the "dual_commands" script first tries the host on a wired connection, and then on a wireless connection

V4 allows you to have an array for $Conf{ClientNameAlias} to support this behavior (checking several different host names in order, and picking the first one for which ping succeeds).

Craig

On Thu, Jun 15, 2017 at 8:11 AM, Richard Shaw <hobbes1069 AT gmail DOT com> wrote:
On Thu, Jun 15, 2017 at 9:53 AM, Daniel Berteaud <daniel AT firewall-services DOT com> wrote:
Le 15/06/2017 à 15:53, Michael Stowe a écrit :

I looked on my own setup to answer this question, since I used a similar method under 3.x and have been backing up the local systems under 4.x since the alpha versions.

Turns out I just use a pretty vanilla rsync/ssh setup, and set up ssh keys so the box can log into itself without issues.


That's what I'll do if no other solution is available, but too bad to add the ssh overhead when it was so easy to use plain rsync on v3

You can research options for encryption to change to a lower overhead method and disable compression if it's on by default.

Thanks,
Richard 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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/


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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/

ADSM.ORG Privacy and Data Security by KimLaw, PLLC