Backing up your data with rsync in Mac and Linux

rsync is a file transfer program capable of efficient remote updatevvia a fast differencing algorithm.

Simplest way to sync up your directory without overriding the new files in the destination is:

rsync -vrupogt temp/ temp2/

for dry run


- n is dry nun
rsync -vrupogt temp/ temp2/

Here is the description of options:

-r, --recursive             recurse into directories
-u, --update                skip files that are newer on the receiver
     --inplace               update destination files in-place (SEE MAN PAGE)
     --append                append data onto shorter files
     --append-verify         like --append, but with old data in file checksum

-p, --perms                 preserve permissions
-o, --owner                 preserve owner (super-user only)
 -g, --group                 preserve group
     --devices               preserve device files (super-user only)
     --specials              preserve special files
-t, --times                 preserve modification times


Here is the doc from rsync man page:

Usage: rsync [OPTION]… SRC [SRC]… DEST
or rsync [OPTION]… SRC [SRC]… [USER@]HOST:DEST
or rsync [OPTION]… SRC [SRC]… [USER@]HOST::DEST
or rsync [OPTION]… SRC [SRC]… rsync://[USER@]HOST[:PORT]/DEST
or rsync [OPTION]… [USER@]HOST:SRC [DEST]
or rsync [OPTION]… [USER@]HOST::SRC [DEST]
or rsync [OPTION]… rsync://[USER@]HOST[:PORT]/SRC [DEST]