It is always recommended to copy the contents from local machine to remote machine or vice versa using rsync with ssh enabled. It’s insecure method to copy files via rsync without using ssh to other remote machines.

Here is the command to copy the contents between remote machines using rsync with ssh custom port number

rsync -avrz –rsh=’ssh -p2011 -i serverkey.pem’ source_content

Following is the command to exclude some contents from copying to other machine

In this case I don’t want to copy “source_content/tmp” directory to another machine and the command is

rsync -avrz –rsh=’ssh -p2011 -i serverkey.pem’ –exclude=source_content/tmp source_content

Related articles

Subscribe Our Free Newsletter

Delivered by FeedBurner. We Respect Your Privacy

Leave a Reply

%d bloggers like this: