Transfer file to a remote server

rsync -azh path_to_file -e 'ssh -p port_number' user@host.com:/remote_destiantion

or

rsync -e 'ssh -p port' -avzr /home/file  root@IP:/home/destination

or

rsync -av --progress --inplace --rsh='ssh -p1777' /tmp/file_name root@IP:/tmp/

from remote to local :

rsync -avz -e "ssh -p port_number" root@IP:/source/ /destination

 

where

z : compression; v : Verbose ; r : Recursive;

Note :
There is an important thing while giving the source parameter.
rsync -az source ip:/destination will move the folder source to the destination
while
rsync -az source/ ip:/destination will move all the contents of the folder source to the destination

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s