-4

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
2

2 Answers 2

2

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.

0
2

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.

Not the answer you're looking for? Browse other questions tagged .