Skip to content

Instantly share code, notes, and snippets.

@SilverSoldier
Last active December 13, 2017 12:11
Show Gist options
  • Save SilverSoldier/1282cf743e3e32f0a9d4b989c977b674 to your computer and use it in GitHub Desktop.
Save SilverSoldier/1282cf743e3e32f0a9d4b989c977b674 to your computer and use it in GitHub Desktop.
rsync simplified

Simple list of rsync command line options

General options

-v --verbose prints list of changed files, time, amount of data copied etc

-n --dry-run

-q --quiet no messages - when running scripts

--progress show progress of transfer

Specific options

-a --archive copy files recursively and preserve group and user ownership when copying files

-z --compress

-r --recursive

-R --relative use relative path names

-e --rsh specify protocol to use for remote shell

Typical usage

$ rsync -acvz SRC [DEST]

Complete list of rsync command line options with explanation

Understanding rsync usage for files and folders

Files are represented in small letters, folder in caps

$ rsync SRC [DEST]

Files:

$ rsync F1/g F2/g
$ rsync F1/g F2

do the same thing, create g inside F2 and put the contents of F1/g in F2/g

Folders:

$ rsync -r F1/G F2/

creates folder G inside F2, copies contents of F1/G and puts it in F2/G

$ rsync -r F1/G F2/G 

creates folder G inside F2, creates folder G inside G, copies contents of F1/G and puts it in F2/G/G

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