Rsync problem: command not found
I am trying to run a simple rsync job on RHES4 but keep getting a command not found error. The job is this:
rsync -r <my user>@<my server>:/home/myuser/ /batch/ This is the error message: bash: rsync: command not found rsync: connection unexpectedly closed (0 bytes received so far) [receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(359) I have tried feeding it the rsync path with --rsync-path=/usr/bin/rsync but still not luck. Ideas? |
How about just placing the full path to the executable:
/usr/bin/rsync -r <my user>@<my server>:/home/myuser/ /batch/ And you might want to put /usr/bin in your users path, this is a common place for most executables you'll end up running anyways. I find it strange it's not already in your path, unless you don't have rsync installed. ;) |
that looks like rsync is not installed on the remote server. is it?
|
Quote:
|
I tried this but I get the same error:
/usr/bin/rsync -r <my user>@<my server>:/home/myuser/ /batch/ bash: rsync: command not found rsync: connection unexpectedly closed (0 bytes received so far) [receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(359) Rsync is on my server: which rsync /usr/bin/rsync It is not on the remote server, but as trickykid stated, my understanding was that it did not need to be. |
Quote:
/usr/bin/rsync -r -e ssh <my user>@<my server>:/home/myuser/ /batch/ |
Hmmm. Same error. Maybe it does need to be installed on the remote server?
|
Quote:
|
Seems to be. This is going to Windowz over SSH so I was hoping that I could just use rsync to copy only new files over. Does SCP have an rsync-like option to only copy new files?
|
Wait, you're trying to go from Linux to Windows? SCP does not to my knowledge have rsync type capabilities and will overwrite existing files, etc.
|
Yes (unfortunately) Linux -> Windoze. I read some information on the Samba / rsync list that this was possible, if ssh was set up. Apparently not, however. Maybe rdiff will work.
|
Quote:
|
This looks like what you want:
http://www.captain.at/howto-rsync-linux-windows.php http://www.brentnorris.net/rsyncntdoc.html |
Just install cygwin on your windows box. Make sure the following are installed:
- All packages in admin - unzip/zip from archive - select vim in editors - in Net, select openssh client/server, then rsync - everything else default Once cygwin is finished, open the cygwin bash shell, and run: ssh-host-config Say yes to everything and follow instructions to start the service. Voila, you are all set. If you still get the same error, make sure you specify where rsync is remotely with the following option: --rsync-path=<path to rsync on windows box> Hope this helps. |
In my case I was trying to rsync from Mac OS to CentOS. rsync has to be installed on the remote box, but it is expected to be at /usr/sbin/rsync instead of /usr/bin/rsync. I just created a symlink on my remote machine:
ln -s /usr/bin/rsync /usr/sbin/rsync Now rsync works |
Instead of making a symlink (though it works), you can use the --rsync-path switch:
Code:
--rsync-path=PROGRAM specify the rsync to run on remote machine |
Rsync is required on both ends
Working on a new mail server install, when I tried to copy the information from the old server using rsync via ssh I got the same error.
Installed rsync on new machine..... error went away. It makes sense that you need rsync on both based on the fact that it uses a specific algorithm to determine file changes. Quote:
|
There's a simple way to use rsync when it is only installed on one side - mount the other side's relevant file system as a file share (sshfs, or nfs, or samba, or whatever), and then use rsync to copy files to/from that file share.
I like using rsync in this fashion because the other side doesn't need any special setup other than serving up a file share. The only real downside to having rsync only on one side is that you can't conserve bandwidth by doing binary checksum comparison. You have to rely entirely upon timestamp/filesize to detect unchanged files. IMHO, this is not a big deal. I mean, what are the chances that a file is going to have its timestamp altered but the contents remain the same? Okay, depending on the file share and file system involved, this could happen a LOT. In particular, there are Windows issues with daylight savings time, and Windows file systems don't have the same timestamp granularity as *nix. You can work around the latter by using a slop range of a couple seconds, but daylight savings time is ... annoying. |
All times are GMT -5. The time now is 03:19 AM. |