Is this syntax wrong for rsync
command? The target server is using port 2222
as ssh port but I can't define it right in the rsync
command.
rsync -dr /home/88/public_html/download/ali -e ssh ssh -p 2222 [email protected]:/home/44/public_html -v
Is this syntax wrong for rsync
command? The target server is using port 2222
as ssh port but I can't define it right in the rsync
command.
rsync -dr /home/88/public_html/download/ali -e ssh ssh -p 2222 [email protected]:/home/44/public_html -v
The command should be:
rsync -e 'ssh -p 2222' -dr /home/88/public_html/download/ali [email protected]:/home/44/public_html -v
The -e
option allows you to specify the remote shell AND all options that go with it.
Try below syntax
rsync -e "ssh -p 2222" -avz --exclude-from '/root/scripts/kexlude.txt' /home/88/public_html/download/ali/ [email protected]:/home/44/public_html/
--exclude-from is optional if you want skip any files in synchronization, you can put file/folder path in /root/scripts/kexlude.txt.(one per line)
also you add --dry-run in syntax to test sync output without doing actual transfer.