Thursday, March 30, 2017

Rsyc push and pull over ssh | Sany's Linux and Open Source Blog

Rsyc push and pull over ssh | Sany's Linux and Open Source Blog





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.

No comments: