Skip to content

Instantly share code, notes, and snippets.

@justsml
Created April 13, 2017 08:07
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save justsml/1c79d51c9539ed5da9fe3c0dd0d839cc to your computer and use it in GitHub Desktop.
Save justsml/1c79d51c9539ed5da9fe3c0dd0d839cc to your computer and use it in GitHub Desktop.
rsync: the good parts

Rsync is amazingly powerful

There are 100's of options for rsync

And I can't remember the options to save my life - and that man page, just goes on and on...

My cheat sheet is 99% of the important ones:

I'll add explainers and examples in a follow up.

--archive               -a          archive mode; equals -rlptgoD (no -H,-A,-X)
        -r, --recursive             recurse into directories
        -l, --links                 copy symlinks as symlinks
        -p, --perms                 preserve permissions
        -t, --times                 preserve modification times
        -o, --owner                 preserve owner (super-user only)
        -g, --group                 preserve group
        -D                          same as --devices --specials

--backup               -b              -- make backups into hierarchy at indicated directory                                                                                                
--backup-dir                           -- make backups into specified directory                                                                                                             
--delay-updates                        -- put all updated files into place at end of transfer                                                                                               
--delete-delay         --delete-after  -- receiver deletes after transfer                                                                                                                   
--force                      -- force deletion of directories even if not empty                                                                                                   
--ignore-existing            -- ignore files that already exist on receiving side                                                                                                 
--inplace                    -- update destination files in-place                                                                                                                 
--itemize-changes      -i    -- output a change-summary for all updates                                                                                                           
--max-delete                 -- do not delete more than NUM files                                                                                                                 
--max-size                   -- do not transfer any file larger than specified size                                                                                               
--munge-links                -- munge symlinks to make them safer, but unusable                                                                                                   
--one-file-system      -x    -- do not cross filesystem boundaries                                                                                                                
--partial                    -- keep partially transferred files
--prune-empty-dirs     -m    -- prune empty directory chains from file-list

--dry-run              -n    -- perform a trial run with no changes made
--whole-file           -W    -- copy files whole (w/o delta-xfer algorithm)
--sparse               -S    -- handle sparse files efficiently
--preallocate                -- allocate dest files before writing
--remove-source-files        -- sender removes synchronized files (non-dir)
--compress-level=NUM            explicitly set compression level
--filter=RULE          -f       add a file-filtering RULE
                       -F       same as --filter='dir-merge /.rsync-filter'
--human-readable       -h       output numbers in a human-readable format
--progress                      show progress during transfer
                       -P       same as --partial --progress
--bwlimit=RATE                  limit socket I/O bandwidth
--append                        append data onto shorter files
--append-verify                 --append w/old data in file checksum
            
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment