Automating my Dissertation Backup with Keyboard Maestro

One of the greatest horrors for all PhD students is the fear of losing your dissertation through some sort of computer disaster. We’ve all heard the stories, or perhaps suffered the consequences of data getting deleted accidentally or a hard drive failing. I have a number of precautions in place to make sure that if one of these things happens, I am protected. I live inside Dropbox, for example, meaning that every document I create is automatically pushed to the Dropbox servers. I have an external ReadyNAS system (on loan from a friend. Thanks, Jeremy!) that not only serves as an external hard drive, but is actually three hard drives that creates redundancy in those hard drives so that if one of them malfunctions, the data is also saved on one of the other drives. I also have Time Machine set up on a separate hard drive that also includes my dissertation data. And, lastly, I carry around the actual written draft of my dissertation on my keychain on a USB stick. This way, if my house burns down or there is a robbery, I’ll at least have the written draft on my person.


One of my favorite tricks with the USB stick is the automated backup I’ve created using the application Keyboard Maestro. This is a fun application that sets up automated workflows that are triggered by any number of actions, ranging from a time of day to a specific key stroke. In this case, the workflow is triggered when I plug in the USB stick. Once the stick is mounted, Keyboard Maestro launches into action. I get a notification telling me a backup is in progress. The copy of my dissertation on the USB stick is deleted, and then the copy from my computer is copied onto the stick. I then get another notification letting me know it’s done, and I can remove the USB stick safely.

The beauty of this system is that it means I don’t have to actually do anything: I just plug in the stick, and the backup is completed behind the scenes. This way, I never run the risk of accidentally missing a chapter in the copying process. It also means that it doesn’t feel like a task or something I have to do. I just plug in a USB stick. Backing up my work is one of the most critical parts of writing my dissertation, and this simple workflow removes every single possible barrier to me making sure it’s safe.

What tips and tricks do you use to keep your dissertation and other research safe and secure?

  • Jeremy

    Terry, you might want to change your script so that you copy the new version of your dissertation before you delete the version on your memory stick. For example, when you insert the stick, rename the copy on it to something else, then copy the new version in, then delete the old copy.

    Right now you have a window where you have no backup at all.

    • Jeremy – yeah, I know that I’m left vulnerable for a couple minutes. I tried to mess around to make this not the case. For example, it won’t do a direct replace. I’ve found that the more intricate I try to get with these workflows, whether in Keyboard Maestro or Hazel, they start to not work, and trouble shooting that can be a pain. I’m even having some trouble replicating this exact workflow between my mac and ReadyNAS (although larger…that backup includes all my dissertation stuff, not just the written pages). So, to mitigate this brief moment that I’m not backed up on my USB stick, I rely on Dropbox, which I live in, meaning that every document I create or save is in dropbox. Always. While I don’t recommend relying on Dropbox as your only source for backup, I think that it’s alright for the few minutes that I need it here. So, it’s not that I don’t have any backup at all…I just only have one backup at that exact moment.

  • BakariC

    Good idea. So what is the action that finds the file to delete. It says “Recursively Delete File.” Is that an action or a script you created? I see an action in KM that can delete a file that is placed in the path, but I don’t see a KM action that can delete a file automatically when it’s in a folder. Hope I’m being clear here. Thanks for the feedback.

    • Bakari – thanks for the question. The Macro I used is the “Delete a File” macro, but you have to select “Delete Dir” from the pull down once you put it into the action slot. The name then changes to “Recursively Delete File”. I don’t know why, but it doesn’t work unless you change it to this setting. Hope that helps!!

      • BakariC

        Thanks Terry, I’m not sure why I missed that. It now works for me, but I had to use a Hazel hack that changes the original file name because the exported file always gets a unique date in it. So Hazel changes the file name to a generic title and then KM can delete it when I run the macro. Thanks for posting your macro. It definitely introduced me to an action I didn’t know existed. This is a nice little time saver.

        • glad you figured it out! It is a nice little time saver, and it’s nice to just not have to think about. Just plug in and wait.