June 4, 2012 0

using rsync for backup

By in rsync

use rsync to backup content and ensure that files deleted on source is not deleted on destination but copied to backup directory

example

rsync --verbose --progress --stats --compress --recursive --times --perms --links --delete --backup --backup-dir=../backup\ of\ deleted\ content/ --exclude=backup-dir/ rsync\ source/ rsync\ dest/current\ nas\ content/

The –exclude=backup-dir/ is properly not needed

 

If you are not interested in moving deleted files from the source to a backup directory but just want to ensure that files that have been transferred one from the source to destination are not deleted on a subsequent execution of the rsync script then remove all with backup and the flag –delete

e.g.

rsync --verbose --progress --stats --compress --recursive --times --perms --links rsync\ source/ rsync\ dest/


Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/mgis.dk/about/wp-includes/class-wp-comment-query.php on line 399

Leave a Reply