I am trying to setup an automated rsync job between my server and client. The server ssh daemon listens to port 8888 (for security reasons) and as such I have to issue the following command to get rsync to work
Hard coding this into a sh script works, however I would like to tidy things up and use variables. So I split everything up and have the following:
rsync -avz --rsh='ssh -p 8888' user@server:/remote/dir /local/dir/
But this results in rsync failing with the following messages:
RSYNC_OPTIONS="-avz --rsh='/usr/bin/ssh -p 8888'"
$RSYNC $RSYNC_OPTIONS $RSYNC_REMOTE_HOST:/remote/dir /local/dir/
I'm guessing the single quotes are interfering in some way. Any ideas?
building file list ... rsync: link_stat "/usr/local/bin/8888'" failed: No such file or directory (2)
rsync: link_stat "/usr/local/bin/user@servr:/remote/dir" failed: No such file or directory (2)