Skip to content

Instantly share code, notes, and snippets.

@rajinder-yadav
Created August 1, 2021 00:22
Show Gist options
  • Save rajinder-yadav/1fa3235a19403211cc8e5823362c61bf to your computer and use it in GitHub Desktop.
Save rajinder-yadav/1fa3235a19403211cc8e5823362c61bf to your computer and use it in GitHub Desktop.
Copying folders and files with rsync

Copying folders and files with rsync

How to copy files and folders (locally).

rsync -arvcEXtP source destination

Add options, "-l" and "-H" for symlinks and hard links if required. Add "-z" to compress is doing over the networks. Add "-u" to update and ignore newer files on destination.

Double checking transfers

diff -qr source destination

The diff is not required as using "-c" for checksum should be sufficent to compare rsync-ed files. This is just an additional paranoid step for critical files.

rsync(1) - Linux man page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment