Mirror folder to external USB disk

Let’s say that there’s a Folder A that you update regularly and you want it from time to time to copy the changes to an external USB hard disk.

This is the command I use:

rsync -av --delete /media/backup/ /media/usbdrive/
diff -rq /media/backup/ /media/usbdrive/

The rsync manual is:

The options above put rsync in archive mode (copies recursive, keeps timestamps, etc), does also remote deletes in case a file went away from Folder A and prints verbose messages so that I know everything is on track.

The diff is to ensure that the data did not get corrupted on the external disk.

Leave a Reply