Rsyc push and pull over ssh

 

Using rsync is the best way copy large size files from/to remote servers.

Since scp command won’t support sync/continue option it’s better to use rsync.

Instead of downloading whole file again after our network got disconnected rsync will download only missing part.

Pull with rsync (copying from remote server):

$ rsync -av --partial --progress --rsh="ssh" user@hostname:<remote_directory/file> <destionation_path>

Push with rsync (copying to remote server):

$ rsync -av --partial --progress --rsh="ssh" <source file/directory> user@hostname:<destionation_path>

or

$ rsync -v -e ssh <source file/directory> user@hostname:<destionation_path>

If you are using any other port for ssh use –rsh=”ssh -p <port_number>”

Eg: --rsh="ssh -p 12345" where 12345 is port number.

-Sany

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