[email protected] wrote at about 00:53:24 -0400 on Friday, May 3, 2019:
> [email protected] wrote at about 00:11:50 -0400 on Friday, May 3, 2019:
> > In v3, when I was backing up on the same server, I eliminated an
> > "unncessary" extra ssh by substituting 'sudo' for 'ssh' using:
> > $Conf{RsyncClientCmd} = '/usr/bin/sudo $rsyncPath $argList+';
> >
> > Not sure how to do this in v4 where one doesn't have access to
> > RsyncClientCmd but instead can only specify:
> > RsyncClientPath
> > RsyncSshArgs
> > SshPath
> > i.e., I don't see how to eliminate the use of ssh...
> >
>
> To clarify, I am trying to generate the following resulting command:
> /usr/bin/sudo /usr/bin/rsync --server --sender -slHogDtpAXrcxe.iLsf
> --iconv=UTF-8
>
> Rather than the ssh version, which would be more like:
> /usr/bin/ssh -l root mymachine /usr/bin/sudo /usr/bin/rsync --server
> --sender -slHogDtpAXrcxe.iLsf --iconv=UTF-8
> (where mymachine really just equals localhost)
>
> If I set:
> SshPath=''
> RsynClientPath ='/usr/bin/sudo /usr/bin/rsync'
> RsyncSshArgs = ''
> I would presumably get the following, close, but non-working commmand:
> mymachine /usr/bin/sudo /usr/bin/rsync --server --sender
> -slHogDtpAXrcxe.iLsf --iconv=UTF-8
>
> I could presumably write a short shell script like:
> #!/bin/bash
> shift
> exec $*
>
> Then set SshPath to the above script (with RsyncSshArgs = '').
> But even if that would work, it seems klugey.
>
>
Just noticed that there is a '-h <host>' switch to 'sudo', so the
following works to allow rsync on the localhost without 'ssh'
$Conf{RsyncClientPath} = '/usr/bin/rsync';
$Conf{RsyncSshArgs} = ['-e', '/usr/bin/sudo -h'];
$conf{SshPath} = '';
The resulting command is of form:
usr/bin/sudo -h <host> /usr/bin/rsync --server --sender
-slHogDtpAXrcxe.iLsf --iconv=UTF-8
Since 'host' is the localhost (by choice), adding the '-h <host>' switch to
sudo doesn't do anything different...
Still a bit klugey but at least it's simple...
_______________________________________________
BackupPC-users mailing list
[email protected]
List: https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki: http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/