Re: /usr/bin/ssh not found when rsync is executed within rsnapshot

2014-02-14 Thread Chris Davies

On 10/02/14 05:38, Lorenz wrote:
 i have a problem. But let me first describe my setup. [...rsnapshot 
configuration...]

 cmd_ssh/usr/bin/ssh
 ssh_args-i /home/backupuser/.ssh/id_rsa
 rsync: Failed to exec /usr/bin/ssh -i /home/backupuser/.ssh/id_rsa: 
No such file or directory (2)


There's a bug in some versions of rsnapshot that causes it to try and 
execute cmd_ssh + ssh_args as a single command. The workaround is either 
to put as much of ssh_args as possible into $HOME/.ssh/config for the 
specific target host, or to create a /usr/local/bin/ssh-for-rsnapshot 
type script that incorporates the call to ssh with the relevant arguments.


Chris



smime.p7s
Description: S/MIME Cryptographic Signature
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Re: /usr/bin/ssh not found when rsync is executed within rsnapshot

2014-02-11 Thread Lorenz
 There are 2 easy solutions:
 
 1. put what you need to run in a script and specify --rsh=/path/script.
 
 2. put your ssh options into your ~/.ssh/config file, and stop specifying
 --rsh.  If you only want that key sometimes when going to that host, you
 can specify a host alias in the config.  For instance:
 
 Host debx40-backup
 Hostname debx40
 User backupuser
 IdentityFile /home/backupuser/.ssh/id_rsa
 
 That even lets you omit the backupuser@ prefix on the command, since you
 told ssh to use the right user, but only if you use debx40-backup:/ for
 the destination host.  If you always want those options, just remove the
 -backup suffix (and the Hostname line) and they will get used for every
 ssh to debx40 (by name).


that one really helped me out.

Thanks a lot.
Lorenz
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: /usr/bin/ssh not found when rsync is executed within rsnapshot

2014-02-10 Thread Paul Slootman
On Mon 10 Feb 2014, Lorenz wrote:

 grep -v # /etc/rsnapshot | grep [a-z]
 i.e. the /etc/rsnapshot minus the comments and the empty lines:

I'd recommend using 'grep .' to find non-empty lines... shorter and more
accurate :-)

 rsync_long_args   -ev --rsync-path=/home/backupuser/rsync-wrapper.sh

-e is the short version of --rsh so I don't know what you're trying to
do here... use the 'v' command instead of (the default) ssh? Probably not.

 /usr/bin/rsync -av -ev --rsync-path=/home/backupuser/rsync-wrapper.sh \
 --rsh=/usr/bin/ssh -i /home/backupuser/.ssh/id_rsa backupuser@debx40:/ \
 /media/extfp/Backup/rsnapshot/test/hourly.0/debx40/
 rsync: Failed to exec /usr/bin/ssh -i /home/backupuser/.ssh/id_rsa: No such 
 file or directory (2)

Besides the extraneous -e option this should work.
The error message is a bit misleading though.

Make sure that there are no wrong whitespace characters in there.
I've fallen into the trap of copypasting commands / configs from
websites and having them fail mysteriously, until I noticed I could not
left-shift those lines in vim with  . Those leading spaces were not
spaces but no-break spaces, hex value 0x80.

So check your config / scripts with LANG=C cat -v /etc/rsnapshot etc.

 What could be the reason? How could i debug this?

I often use strace -f -e execve command ... and / or
strace -f -e execve command ... in such cases to see what
it is really trying to run.

Paul
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: /usr/bin/ssh not found when rsync is executed within rsnapshot

2014-02-10 Thread Wayne Davison
On Mon, Feb 10, 2014 at 1:44 AM, Paul Slootman paul+rs...@wurtel.netwrote:

 Besides the extraneous -e option this should work.


No, the later --rsh option overrides the weird v string, so that's not
the issue.  It appears to be that whatever compiled version of rsync he is
using doesn't allow args -- it seems to be trying to find the command using
the full string, including spaces and ssh options.  Since normal rsync
allows command args there, I don't know what is strange about his setup.

There are 2 easy solutions:

1. put what you need to run in a script and specify --rsh=/path/script.

2. put your ssh options into your ~/.ssh/config file, and stop specifying
--rsh.  If you only want that key sometimes when going to that host, you
can specify a host alias in the config.  For instance:

Host debx40-backup
Hostname debx40
User backupuser
IdentityFile /home/backupuser/.ssh/id_rsa

That even lets you omit the backupuser@ prefix on the command, since you
told ssh to use the right user, but only if you use debx40-backup:/ for
the destination host.  If you always want those options, just remove the
-backup suffix (and the Hostname line) and they will get used for every
ssh to debx40 (by name).

..wayne..
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html