/usr/bin/ssh not found when rsync is executed within rsnapshot
Hello, yesterday i posted this issue on snapshot-disc...@listsourceforge.net (subject: wondering why backup wont start), but after reading the FAQ and searching the bugzilla DB i thought it could help to post here as well. i have a problem. But let me first describe my setup. i followed this howto: http://dev.kprod.net/?q=linux-backup-rsnapshot-no-root Now there is a backup server rpi-home and a remote host debx40. On both these computers there is debian jessie (with rsnapshot version 1.3.1) installed, there is a user backupuser and as far as i can see the remote login with password for that user works: backupuser@rpi-home ~ $ ssh debx40 -i ~/.ssh/id_rsa Linux debx40 3.12-1-486 #1 Debian 3.12.9-1 (2014-02-01) i686 ###some greeting lines### $ whoami backupuser here is the result of grep -v "#" /etc/rsnapshot | grep [a-z] i.e. the /etc/rsnapshot minus the comments and the empty lines: config_version 1.2 snapshot_root /media/extfp/Backup/rsnapshot/test/ no_create_root 1 cmd_cp /bin/cp cmd_rm /bin/rm cmd_rsync /usr/bin/rsync cmd_ssh /usr/bin/ssh cmd_logger /usr/bin/logger retain hourly 6 retain daily 7 retain weekly 4 verbose 5 loglevel5 logfile /var/log/rsnapshot.log lockfile/var/run/rsnapshot.pid rsync_long_args -ev --rsync-path=/home/backupuser/rsync-wrapper.sh ssh_args-i /home/backupuser/.ssh/id_rsa link_dest 0 rsync_numtries 1 backup backupuser@debx40:/ debx40/ and this is the content of /home/backupuser/rsync-wrapper.sh on the remote debx40. #!/bin/sh date >> /home/backupuser/backuplog echo $@ >> /home/backupuser/backuplog /usr/bin/sudo /usr/bin/rsync "$@"; in the /etc/sudoers there is a line backupuser ALL=NOPASSWD: /usr/bin/rsync when i enter e.g. sudo rsnapshot -D hourly on the backup server rpi-home i get this require Lchown Lchown module loaded successfully Setting locale to POSIX "C" echo 4702 > /var/run/rsnapshot.pid mkdir -m 0755 -p /media/extfp/Backup/rsnapshot/test/hourly.0/ /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) rsync error: error in IPC code (code 14) at pipe.c(85) [Receiver=3.1.0] rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(226) [Receiver=3.1.0] rsnapshot encountered an error! The program was invoked with these options: /usr/bin/rsnapshot -D hourly ERROR: /usr/bin/rsync returned 12 while processing backupuser@debx40:/ /usr/bin/logger -i -p user.err -t rsnapshot /usr/bin/rsnapshot -D hourly: \ ERROR: /usr/bin/rsync returned 12 while processing backupuser@debx40:/ touch /media/extfp/Backup/rsnapshot/test/hourly.0/ No directory to delete: /media/extfp/Backup/rsnapshot/test/_delete.4702 rm -f /var/run/rsnapshot.pid /usr/bin/logger -i -p user.err -t rsnapshot /usr/bin/rsnapshot -D hourly: \ ERROR: /usr/bin/rsnapshot -D hourly: completed, but with some errors I suppose the important info is in that line rsync: Failed to exec /usr/bin/ssh -i /home/backupuser/.ssh/id_rsa: No such file or directory (2) but surprisingly to me: the Backup starts when i do sudo /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/ , which is the exact same command (copy-pasted from the rsnapshot output) that caused the error in the first place. Except the sudo in front of it. What could be the reason? How could i debug this? -- kind Regards Lorenz from Greifswald -- 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
> 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
rsync filter rules ignored by rsnapshot
Hello guys, sorry for cross-posting, but imho it could be an error in my rsnapshot setup as well as in my rsync setup. If there is a solution on one of these mailing-lists i will post it to the other one as well. ok? here is my question: when running rsnapshot, my exclude filter is being ignored, but i don't see why. grep -v "#" /etc/rsnapshot-debx40.conf | grep . gives config_version 1.2 snapshot_root /media/extfp/Backup/rsnapshot-debx40/ no_create_root 1 cmd_cp /bin/cp cmd_rm /bin/rm cmd_rsync /usr/bin/rsync cmd_ssh /usr/bin/ssh cmd_logger /usr/bin/logger retain daily 7 retain weekly 4 retain monthly 3 verbose 5 loglevel5 logfile /var/log/rsnapshot.log lockfile/var/run/rsnapshot.pid rsync_long_args -ev --rsync-path=/home/backupuser/rsync-wrapper.sh exclude "**no-backup**" link_dest 0 rsync_numtries 1 backup backupuser@debx40:/home/lorenz/ home/lorenz/ backup backupuser@debx40:/etc/ etc/ backup backupuser@debx40:/root/root/ rsnapshot -D -c /etc/rsnapshot-debx40.conf daily works but e.g. /home/lorenz/testsource/no-backup/some-file is also rsynced, despite it would match the exclude pattern in my /etc/rsnapshot-debx40.conf running the except same rsync command as printed out by rsnapshot -tD -c /etc/rsnapshot-debx40.conf daily, namely /usr/bin/rsync -av -ev --rsync-path=/home/backupuser/rsync-wrapper.sh --exclude="**nobackup**" --rsh=/usr/bin/ssh backupuser@debx40:/home/lorenz/ /media/extfp/Backup/rsnapshot-debx40/daily.0/home/lorenz/ works and e.g. /home/lorenz/testsource/no-backup/some-file is really excluded. after hours of fiddling around with filter rules i finally tried using an exclude-from file and it worked perfectly. Could the failing of the attempt with exclude filters in /etc/rsnapshot-debx40.conf be a bug? could this misbehavior be related to the problem i posted some days ago (see "[rsnapshot-discuss] wondering why backup wont start" or "/usr/bin/ssh not found when rsync is executed within rsnapshot" on the rsync mailing-list)? -- keep rockin 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: Options for a "I'm done" flag file
Or rsync -avH ${all_gubbins} / user@remote.machine:/dest/ && ssh user@remote.machine touch /etc/donefile so your client touches a file on your server (that sounds so wrong...) Am 28.04.2015 um 13:36 schrieb Simon Hobson: > Michael Johnson - MJ wrote: > >> rsync -av /src/ /dst/ && touch /dst/done > > A, knew I'd miss some detail. > All the syncs are pushed to the backup server. > > But that does give me an idea. I guess I could do that on the source, then > sync the flag file over. > rsync -avH ${other_gubbins} / user@remote.machine:/dest/ && > touch /etc/donefile && > rsync -av ${some_other_gubbins} /etc/donefile user@remote.machine:/dest/ > > That (or some variation of it) could work. > -- 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