rsync (Draft)

Page content

Why rsync not SCP

It can restart download (fragmentation method?).

Download a file from remote

Download a folder from remote

(@rsync_dir)  rsync -avzhP remote_user@remote.com:/path/to/dir ./

-a: archive -h: human redable output -z: compress (like zip) data during the transfer -v: verbose -P: –partial + –progress

Sync - upload a current structure under the remotedir

In dir,

rsync -ahzv ./* remote-user@remote.com:/path/to/dir/

It will overwrite the same name file!!`

Skip (almost) same contents

--size-only skips files that match in size.

Check diff (dry run)

rsync -rvc --delete --dry-run /home/usr/dir/ host2.com:/home/usr/dir/

Before rsync

If you archive the files, you can preserve the permissions of the files.