Hi guys,
I'm trying to set-up a cron job that uses rsync to transfer back files from a remote server. ssh on the remote server is running on port 12345 but this seems to be a problem.
My script looks like this:
Code:
#!/bin/sh
RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
KEY=/home/username/.ssh/id_rsa.pub
RUSER=ruser
RHOST=hostip
RPATH=/var/usr_backups
RPORT=12345
LPATH=/var/backup/dhops
$RSYNC --rsh='ssh -p$RPORT' -az -e "$SSH -i $KEY" $RUSER@$RHOST:$RPATH $LPATH
This script runs an error suggesting that --rsh is incorrect.
How should I be specifying the port number?