websavages
December 28th, 2010, 01:30 PM
Hi all,
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
rsync -avz --rsh='ssh -p 8888' user@server:/remote/dir /local/dir/
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=/usr/bin/rsync
RSYNC_OPTIONS="-avz --rsh='/usr/bin/ssh -p 8888'"
RSYNC_REMOTE_HOST="user@server"
$RSYNC $RSYNC_OPTIONS $RSYNC_REMOTE_HOST:/remote/dir /local/dir/
But this results in rsync failing with the following messages:
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)
I'm guessing the single quotes are interfering in some way. Any ideas?
ws
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
rsync -avz --rsh='ssh -p 8888' user@server:/remote/dir /local/dir/
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=/usr/bin/rsync
RSYNC_OPTIONS="-avz --rsh='/usr/bin/ssh -p 8888'"
RSYNC_REMOTE_HOST="user@server"
$RSYNC $RSYNC_OPTIONS $RSYNC_REMOTE_HOST:/remote/dir /local/dir/
But this results in rsync failing with the following messages:
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)
I'm guessing the single quotes are interfering in some way. Any ideas?
ws