i’ve been thinking a lot about backups lately, and have been inspired to make sure my dissertation is backed up so that if anything were to happen to my laptop all the work i’ve done won’t just disappear. when i worked in industry, it was somebody else’s job to make sure my laptop backed up automatically every day at noon (at Moto i guess they expected everybody to go to lunch at that time, so the degraded system performance wouldn’t matter as much). but as a student who owns my own computing equipment, it is my responsibility to make sure i’m prepared in the event something catastrophic happens to my laptop. i have two external USB backup drives at home: one that is a backup of my laptop, and another that is a backup of the backup in case the first drive fails. i back up as often as i remember to, which ends up being every 1-2 weeks.
however, the recent crash of the US Airways Airbus in the Hudson River inspired me to find a solution for backing up my most critical data (i.e., my dissertation) more frequently. everyone survived that crash, but had to leave carryon baggage behind when they evacuated. my anecdotal impression is that 100% survival in a plane crash seems like the exception rather than the rule, and it is more likely that if i were to be in a crash that the last thing i would be worried about is whether my dissertation is safe (duh). but, nevertheless, at this point losing a couple weeks worth of work feels like it would be a personal disaster. i know, i know, i am not normal.
so i spent some time over the weekend trying to figure out how to automatically back up my dissertation (about 1GB of data) on the university network. i’m sure i could subscribe to some kind of backup service, but honestly, i was looking for something that wouldn’t cost me anything. as it turns out, this was a nontrivial undertaking, and the solution is a bit of a kludge so i may end up going the subscription route anyway eventually.
i had already purchased backup software that i’ve been using for about a year, and i like it: Synk Standard. it has a fairly usable interface for selecting which folders and files to back up to what locations, it supports having multiple backup scripts that can be scheduled separately or be triggered upon mounting of a particular drive, and it will even automatically connect to a network drive via smb/cifs. however, there’s the small matter of the VPN — one cannot connect to this particular university network from home (which is usually where i am in the middle of the night when i want this backup to take place) without first firing up the VPN client and connecting, something that Synk is unable to do successfully. And then there’s the matter of disconnecting the VPN client when finished, which Synk can’t do either. Synk does have the capability to open a file or program before starting the backup script and after finishing the script… i was able to get it to trigger the VPN client but it subsequently refused to start the backup. and Synk also was unable execute the AppleScript i wrote to disconnect and close the client — it opened the file in the script editor instead.
i needed some way to automatically launch and then quit the VPN client. it turns out that iCal (on the Mac) can launch a program or run a script as part of an alarm for an event. who knew! so, in addition to scheduling the backup to take place at a certain time through Synk, i also created events in iCal for starting up the VPN client (which thankfully connects automatically once it is started) and shutting down the client. these events are is triggered automatically by iCal at the appointed time, whether or not the application is running.
as if this weren’t complicated enough, through testing i found out that for some reason files copied over to the server have a modified date but no creation date. i didn’t know this was possible, and i’m guessing it might have something to do with Mac vs. Windows issues. but this meant that the backup program was copying EVERY SINGLE FILE every time it ran. this was totally unacceptable, and the only way i could figure out to get around the problem was really ugly. i set up a rule in the backup software such that only files modified AFTER the date of the first backup would be copied over. naturally, this is a stopgap, and i’ll have to change that date every so often or more and more files will be copied over every single time. but for the time being, it works ok. my dissertation will be backed up every night, and i don’t have to lose sleep over leaving my carryon behind in the event of a water landing.