Yet another improvement for the automated backups with rsync

Posted by Pierre Igot in: Macintosh
August 21st, 2005 • 3:07 pm

In two recent articles I discussed the use of the rsync command with AppleScript and iCal to set up automated daily backups to an external FireWire drive.

If you read the discussion that follows the original O’Reilly article that was the inspiration for my posts, you’ll find more about the creation/modification date bug with the built-in rsync command in Tiger, for which the only work-around is to use the third-party RsyncX.

You’ll also find another useful suggestion, which indicates how to prevent rsync from copying the “Caches” folder inside your home library folder, when you are archiving your home folder. Simply put, if you want an rsync command that archives your home folder without the caches (which can take up lots of hard drive space and do not need to be backed up), then you need to add the “--exclude=Library/Caches” attribute to your rsync command.

For example, the rsync command for archiving my home folder in my AppleScript script is now:

/usr/local/bin/rsync -a --eahfs --delete --exclude=Library/Caches ~ /Volumes/Files/FilesBackup 2>>~/rsyncErrX.txt || echo -n

(This is using the rsync command installed by RsyncX.)


2 Responses to “Yet another improvement for the automated backups with rsync”

  1. eboss says:

    Je ne sais pas si vous avez pris en compte ou pas le fait que le volume de destination puisse être absent. Si c’est un disque externe, la probabilité est assez grande d’ailleurs.
    Ça vaudrait certainement le coup d’encapsuler le lancement de rsync dans un script shell qui teste d’abord si “/Volumes/Files/FilesBackup” existe et si c’est bien un volume.
    Je n’ai pas lu les commentaires des 2 précédents articles sur le sujet donc excusez moi si la question a déjà a été traitée.

  2. Pierre Igot says:

    Non, je n’ai pas traité cette question, pour la simple raison que cette précaution n’est pas nécessaire dans mon cas. (J’ai un disque dur externe qui reste branché en permanence.) Mais je crois que la discussion sur O’Reilly en parle.

Leave a Reply

Comments are closed.