How to Backup and Version Control a Single Obsidian File, on a Mac
An elegant alternative for people who don’t get on with Git
You already know you should be backing up your work, and I’ll optimistically assume you’re already doing that. But are you doing enough? Do you have sufficient version control of your most important files, without spamming your backup service?
I know, I know. Git does this very, very well. But for those of us who are ambitious, but haven’t yet tamed the Mighty Git, Hazel provides an elegant solution.
As a self-proclaimed cheapskate, I’ve chosen a paid app to back up and version control specific files in my Obsidian vault over a free one, because —
I get Hazel, and it works. Plus, I already own it.
I can’t make Git consistently bend to my will, despite following tutorials.
One day I hope to be able to invite Git to all my parties and not need subtitles for everything it says. Even so, Hazel and I are such good friends, that I suspect I’d spend more time talking with them at a party, than I would our more code-driven pal.
Next, how I’m backing up my Obsidian vault. And, specifically, making an extra, version-controlled backup of my most used file.
Repeat after me: I Must Back Up My Obsidian Vault! Today!
Paranoid must be my middle name, as I already back up my entire hard drive, including my Obsidian vault, with Dropbox, iCloud, and Backblaze, and still find myself looking for more. Times past have shown me that backups fail, and even with all that in place I’ve occasionally lost a file.
Obsidian has some nice backup plugins you should check out, if you haven’t already:
Obsidian Git has nearly 425K downloads at the time of writing, so clearly there are a lot of happy users. It worked for me for a while, and then it didn’t. No clue why, and I decided to stop wasting hours looking into it.
Aut-O-Backups syncs your entire vault to Dropbox, at regular intervals. Good for version control, but not great for saving space. It literally backs up everything every few minutes, modified or not, making search a nightmare.
Remotely Save is the plugin I’m using now to back up to Dropbox. S3, webdav, and OneDrive are other destination options. As files are modified in your vault, they’re replaced in the backup.
I’m happy with Remotely Save, but realised recently that I’d rather not have to rely on Dropbox’s versioning to recover one specific, extensive file that I’m constantly modifying throughout the day: my To Do list in TaskPaper format.
Projects and Tasks 2023.md
file is the one file I regularly open in different apps on Mac and mobile. It’s convenient to access a different set of features when interacting with the same file, but it also makes it vulnerable to sync issues and, worst of all, data loss.
Taskmator was the culprit the time I lost over an hour of intense work on my task file. I’d made a lot of small changes all over the joint; not things I could quickly or easily reproduce. Fortunately, I’d already set up Hazel to create a new, dated backup file every 5 minutes after the file changes, so I was up and running again in no time.
How to set up Hazel for incremental, targeted file backups
Choose the folder your target file lives in, then create and name a new rule for this folder.
Change the next section to show the following: If all of the following conditions are met Name is <your file name
> Date Last Modified is in the last <interval of your choice
> minutes
Change the last section: Do the following to the matched file or folder: Copy to folder <choose a folder in your target destination
> Rename with pattern: date modified
< space >name
extension
My date is in year-month-date hour.minute
format. To adjust it, click on date modified
, then click on the dropdown arrow to the right of date modified
, then on edit pattern
.
Pay attention to the spaces between tokens, and hover for tool tips if you aren’t sure about something.
Click save, and you should be good to go.
Each backup file is tiny (14 KB!), and you can group them in months as I have, or just chuck out the oldest ones as you go.
Use the tool that suits you best
Whatever app, tool, script, or plugin you use to back up your precious Obsidian notes, just make sure you use one! Or that you’re disciplined enough to make manual daily/hourly backups if you want to go old-school (doable, but dangerous).
There’s so much more that Hazel can do, I encourage you to look into how it can be your personal valet. Keyboard Maestro can do a lot, but it can’t do everything Hazel can, and vice versa.
FYI I’ll be writing more about my single TaskPaper-esque file in Obsidian in the coming weeks, and why, for me, it’s the best way to get an overall picture of what’s on my plate and what needs doing right now.