I'm trying to rsync files between two servers with
rsync -avlzp /source user@server:/destination
but instead I get errors stating
bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(635) [sender=3.0.2]
but rsync is installed on both servers. What am I doing wrong? I've also tried
rsync -av -e "ssh -l ssh-user" /source server:/destination
with the same result.
I'm mainly trying to use rsync so that it only copies over differences if they exist...
Thanks
rsync may be in the path on the remote machine when running an interactive shell, but not when running rsync by ssh (with a non-interactive shell). .bashrc is normally only run for interactive shells, for example, so if your path is defined there, it will not be parsed when running rsync --server
on the remote end. Try /etc/profile. See bash(1) for more details.
You can use --rsync-path
to specify the path to the rsync binary on the remote machine.