Skip to content

Latest commit

 

History

History
executable file
·
17 lines (13 loc) · 661 Bytes

014-sync-2-directories.md

File metadata and controls

executable file
·
17 lines (13 loc) · 661 Bytes

Sync 2 directories

rsync -cav --delete --progress "/dir/A/" "/dir/B"

Some explanation on what the various command options mean:

-c, --checksum              skip based on checksum, not mod-time & size
-a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
-v, --verbose               increase verbosity
    --delete                delete extraneous files from dest dirs
    --progress              show progress during transfer

Note the ending slash in the first directory path above ("/dir/A/"). The above command will make directory B the same as directory A, DELETING any file in B that is not present in A.