rsync command to copy files between servers

Copy files from one folder to another in same server

rsync -avz /source/folder/ /destination/folder/

Copy files from local server to remote server

rsync -avz /source/folder/ root@ip.of.remote.server:/destination/folder/

Copy files from remote server to local server

rsync -avz  root@ip.of.remote.server:/source/folder/ /destination/folder/

Trailing “/” in the paths are very important in rsync command which should not be skipped. If Trailing “/” in the path is not present, that folder will be recreated in destination


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s