Tuesday, October 15, 2013

Backup files smart way "rsync"

backup images directory in ~/src to ~/target
rsync -vru ~/src/images ~/target

-v : verbose
-r : recursive
-u : update only, skip up-to-date files

If you delete a file in src, or rename a file in src, then you want the old file in target to be deleted.
rsync -vru --delete ~/src/images ~/target

No comments:

Post a Comment