10.5: One way to back up locally-synced .Mac iDisks

Nov 20, '07 02:30:00PM

Contributed by: imcquill

For .mac users, the iDisk is fantastic for keeping a folder synchronized between multiple computers. One can turn on local syncing of the iDisk to have hard drive speed access to this folder shared between multiple machines, which is great. I do almost all my document editing on the iDisk and it is the same everywhere I go. For those who do a lot of document editing, doing some form of version control would be great. Time Machine is perfect for this, as subversion is kind of overkill for documents and small projects.

However, there is a problem with using Time Machine on the iDisk in Leopard: the iDisk in Leopard is not locally synchronized on a file to file basis. The local copy exists as a .sparsebundle file in ~/Library/FileSync. This is done so that the local copy only occupies the same amount of space as the files you currently have in your iDisk. Tiger on the other hand would just take up the full 10GB on your hard drive if that is how much space was allocated for your iDisk. This .sparsebundle looks like one giant file, but it is actually a package which contains a whole bunch of 8MB bands.

Time machine does not let you look at your iDisk back in time, but this sparsebundle is backed up, so in principal one could go back in time and recover a previous iDisk. But one could only recover the entire previous contents of the iDisk rather than individual files on the iDisk. (Note here that if you change an individual file on the iDisk, Time Machine will only backup the bands which have changed, which are at most 8MB, rather than the entire iDisk).

However, this does not help with recovering a single file from the past from the iDisk. There is a hack to do this however.

Take the external hard drive that Time Machine uses and partition it into two partitions. One will be the Time Machine partition, which will be the large partition. The other will contain a snapshot of the current contents of your iDisk documents folder. It only needs to be big enough to hold the entire contents of your iDisk documents at a single point in time. 10GB would be enough for those with 10GB of iDisk storage. So if you've got a 500GB hard drive, make the first partition 480GB and the second whatever is left over.

I wanted to create an automated backup copy of my iDisk Documents folder on this second partition, and then have Time Machine automatically backup this up as well. Then I could go back in time and recover files from this backup partition on a file to file basis.

I downloaded Lingon, which provides a nice GUI for creating launchd entries so that commands can be run on a schedule. Then I created an entry called com.synciDiskdocuments, which would run daily at 3:40am. It would run the following command:

rsync -a --delete --update --whole-file /Volumes/iDisk/Documents/ /Volumes/backup/docbackup/
This would create an duplicate copy of the iDisk Documents folder inside the 'backup' partition (that's the second partition) in the docbackup folder at the current time. It only takes as much space in the docbackup folder as occupied by the iDisk documents folder (files deleted from the iDisk will also be deleted from the docbackup folder), and it only updates the files that have changed. Then if you need to go back in time to recover a file from the iDisk, you can go back in time in the docbackup folder. Note that this synchronization is not two way. If you make a change to the docbackup folder, it will not change anything in the iDisk. So if you go back in time and recover a file from the docbackup folder, it will not put it back on the iDisk, it will put it in the docbackup folder. You'd have to copy it to the iDisk manually. But at least this solution is providing version control of documents on a file by file basis and mostly utilizing Time Machine to do all the work.

To note, that this rsync is only getting run once a day this way, but this seemed OK since Time Machine only backs up hourly during the last day, and more distant backups are done at most daily. If you want to have this done hourly, you could configure Lingon to backup hourly instead of daily. Or you can manually backup the iDisk to the docbackups folder by running that rsync command from Terminal.

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20071107092052825