logo       
Bookmark and Share

Re: ssh_args: msg#00029

sysutils.backup.rsnapshot.general

Subject: Re: ssh_args

Cole,

I think your problem is with this part:
--rsync-path='sudo /usr/bin/rsync'
of rsync_long_args.

Rsnapshot (up to and including 1.2.9) does not recognise quotes when
breaking up the arguments into words, so the list of words fed to exec
probably looks like this:
/usr/bin/rsync
-alptgoHuv
--delete
--numeric-ids
--relative
--delete-excluded
--rsync-path='sudo
/usr/bin/rsync'
--rsh=/usr/bin/ssh -p 2222
net-backup@A:/etc/
/root/backup/snap/daily.0/etc/

The CVS version of rsnapshot has had some work put into improving this
quoting issue (thanks to David Cantrell).

But instead of using the CVS version or waiting for the next version, I
would suggest the easiest thing is for you to create a shell script that
just consists of
sudo /usr/bin/rsync "$@"
and use that shell script as your --rsync-path.

You might also want to use rsnapshot version 1.2.9 which is available
in Debian "testing" (since 2006-06-20) rather than 1.2.1 (in "stable").

On Wed, Jul 12, 2006 at 09:52:53PM -0400, Cole Tuininga wrote:
>
> Hey all, I'm a bit of a rsnapshot newbie, but I don't this this is a
> faq. Either that or I really need to brush up on my google-fu. In any
> case, here's the deal.
>
> I have a server "A" that I need to back up. I have another server "B"
> that is intended to pull the data down. Both are Debian linux boxes
> running rsnapshot 1.2.1
>
> Server "A" has a user named "net-backup" with sudo access to rsync. I
> have ssh set up on port 2222. root on server "B" has an ssh key that
> the net-backup@A trusts. That part works fine - I can connect without a
> password.
>
> Here's the issue. In my rsnapshot.conf file, I specify ssh_args with -p
> 2222 so that it will use the right port. The problem is that it seems
> to be building the rsync connection incorrectly. If I run rsnapshot in
> level 4 output, I see this:
>
> B:~/backup/snap# rsnapshot -c /root/backup/snap.conf daily
> Setting locale to POSIX "C"
> echo 24851 > /var/run/rsnapshot.pid
> mkdir -m 0755 -p /root/backup/snap/daily.0/
> /usr/bin/rsync -alptgoHuv --delete --numeric-ids --relative \
> --delete-excluded --rsync-path='sudo /usr/bin/rsync'
> --rsh=/usr/bin/ssh \
> -p 2222 net-backup@A:/etc/ \
> /root/backup/snap/daily.0/etc/
> building file list ... rsync: link_stat "/usr/bin/rsync'" failed: No
> such file or directory (2)
> rsync: link_stat "/root/backup/snap/net-backup@A:/etc/." failed: No such
> file or directory (2)
> done
> created directory /root/backup/snap/daily.0/etc
>
> The problem seems to be that in the rsync line, because the arguments to
> ssh are separate, rsync is getting confused. If I run this rsync line
> manually, it syncs just fine (note the quotes around the rsh paramter):
>
> /usr/bin/rsync -alptgoHuv --delete --numeric-ids --relative
> --delete-excluded --rsync-path='sudo /usr/bin/rsync' --rsh="/usr/bin/ssh
> -p 2222" net-backup@A:/etc/ /root/backup/snap/daily.0/etc/
>
> My snap.conf file is below. Can anybody offer some ideas as to how to
> fix this? Thanks in advance...
>
> config_version 1.2
> snapshot_root /root/backup/snap/
> cmd_cp /bin/cp
> cmd_rm /bin/rm
> cmd_rsync /usr/bin/rsync
> cmd_ssh /usr/bin/ssh
> cmd_logger /usr/bin/logger
> cmd_du /usr/bin/du
> interval daily 180
> verbose 4
> loglevel 3
> logfile /var/log/rsnapshot.log
> rsync_short_args -alptgoHu
> rsync_long_args --delete --numeric-ids --relative --delete-excluded
> --rsync-path='sudo /usr/bin/rsync'
> ssh_args -p 2222
> du_args -csh
> lockfile /var/run/rsnapshot.pid
> backup net-backup@A:/etc/ etc/
>
> --
> Cole Tuininga <colet@xxxxxxxxxxxxxxx>
> Code Energy (http://www.code-energy.com/)
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> rsnapshot-discuss mailing list
> rsnapshot-discuss@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss

--
___________________________________________________________________________
David Keegel <djk@xxxxxxxxxxxxxxxxxx> http://www.cyber.com.au/users/djk/
Cybersource P/L: Linux/Unix Systems Administration Consulting/Contracting


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise