Linux command: rsync

From RHS Wiki
Revision as of 11:12, 30 July 2015 by Rafahsolis (talk | contribs) (Created page with "== Create backups == rsync -av --delete /Directory1/ /Directory2/ The code above will synchronize the contents of Directory1 to Directory2, and leave no differences between t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Create backups

rsync -av --delete /Directory1/ /Directory2/

The code above will synchronize the contents of Directory1 to Directory2, and leave no differences between the two.
If rsync finds that Directory2 has a file that Directory1 does not, it will delete it.
If rsync finds a file that has been changed, created, or deleted in Directory1, it will reflect those same changes to Directory2.