Monday 2 November 2015

Using Rsync to incrementally transfer a file to remote

Rsync is an open source utility that provides fast incremental file transfer.
Instead of using "scp", we can use "rsync" instead to only transfer updated files to remote machine.
The default remote shell is now "ssh"

For example,

$ rsync -avz -e ssh -i ~/my_key /path/file username@ip:/path

However, you may see below error.

Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]

rsync error: unexplained error (code 255) at /SourceCache/rsync/rsync-45/rsync/io.c(453) [sender=2.6.9]

To solve it,

$ ssh-add ~/my_key
rsync -avz /path/file username@ip:/path


Reference:
https://rsync.samba.org/

No comments:

Post a Comment