Hi, Hayo
I also use two backup drives and I change backup destination each time.
I would like to do the same as you do, but I don't know how.
Could you please tell me what the script would be like and how to run it?
Hi Luiz,
I'm assuming you're on a Mac and know a little bit about the terminal here, but if you just like to keep a second backup completely in sync with the latest state of your data, rsync can be used in a straightforward way from the terminal like so:
rsync <options> <sourceā¦> <destination>Note: Do not put a trailing slash at the end of your source directories or rsync will put the content into destination, not including the directory itself (unless you want that of course).
There are tons of options to rsync, but the ones you will probably want to use are:
-a this sets a lot of options automatically and basically takes care of copying the files as they are (permissions etc.)
-v show progress (i.e., each file that is copied)
--delete this deletes files no longer found
-n is a very handy option to test if you've set everything up correctly; it will run rsync like normal but no files are actually copied/deleted.
I also add
--delete-excluded --exclude='.DS_Store' as I don't care about the
.DS_Store files on my backup.
So you rsync command-line will look something like:
rsync -av --delete --delete-excluded --exclude='.DS_Store' /Users/luiz/Photos /Volumes/SecondBackup/BackupDirIf your backup drive is actually a shared drive on another Mac or on a NAS that is rsync capable, replace
/Volumes/SecondBackup with
<USERNAME>@<HOST>:/BackupDirrsync will now copy over only the bits of file that really changed, dramatically speeding up the process
After you've tested your script, save it into a script file you can then run from the terminal whenever you want.
You could even automatically run it every once in a while, but that's more advanced stuff.
Hope this helps,
Hayo