A trick into using rsync with a custom port
As rsync
will not accept to be given a custom port on the destination address, a way around it is to initiate an ssh
connection that will handle it for you:
rsync -e 'ssh -p 2222' $SOURCE_DIR $DEST_DIR;