I am running this command:
rsync -zavrR --delete --links --stats --rsh="ssh -p 2222 -l user" www.example.com:/home/user/public_html/ /home/user/public_html/rsynctest
Current behavior is that I get
/home/user/public_html/rsynctest/home/user/public_html/. All files in public_html are copied successfully, but I get layers of directories that I don't want.
My desired behavior is that the contents of
public_html from example.com are mirrored to the folder
rsynctest on the local machine (I retain
/home/user/public_html instead of creating the double layered directory structure). How can I achieve this? I thought the trailing slash on the remote directory was supposed to do it, but it's not happening.