Using rsync to copy data locally

What can I say?! Rsync is awesome! The options I normally use for this is:

# rsync -aHAXEWPh source destination

The options above are explained below.

-a--archiveArchive mode. Same as -rlptgoD.
-H--hard-linksPreserve hard links.
-A--aclsPreserve ACLs (implies -p)
-X--xattrsPreserves extended attributes
-E--executabilityPreserves the executability of a file.
-W--whole-fileCopies whole files without delta operations.
-P--progressIndicate progress with output.
-h--human-readableOutput numbers are in a more readable format.

See the man pages for more information

$ man rsync

I also like to use the --dry-run option too the first time I run it just to make sure its actually copying what I think it is. For example, you might run this.

[email protected]:~# rsync -aHAXEWPh /srv/repositories-remote/ /srv/repositories-local/ --dry-run

Nothing will actually get copied with the dry-run option enabled so you’ll need to remove that when you’re sure about what you’re copying.

Be the first to comment

Leave a Reply