Automating Brave Bookmarks Backup with cron

Earlier in 2025, my macbook died all of a sudden and it was wiped clean in the repair process (RIP đŸ„Č). While re-downloading all of my necessities, I realised one very upsetting issue:

All of my bookmarks on Brave Browser were not backed up đŸ˜±đŸ˜­

Despite being able to import my bookmarks from my Google account to my Brave, I did not realise that there was no automatic backup for my bookmarks. Many months of carefully organised bookmarks disappeared just like that. Dejected, I searched the internet for a solution, but what I came across were instead many disgruntled users on the Brave community forum complaining about the same issue - they want to be able to backup their bookmark data and they want a simple way to do this. (Actually, there is a way to backup bookmarks, but it involves syncing with your mobile device which... to me is kinda weird and unnecessary...)

Of course, the easiest way out of this problem was simply for me to switch back to using Chrome. But being the engineer that I am, that wouldn't be rewarding nor enjoyable; anyway I love creating unnecessary solutions for self-inflicted problems đŸ€  So, I set out thinking of a way to get bookmarks backups working in a way that would not inconvenience me in my every day workflow. Ergo, automation would be involved. From a quick google search of whether this has already been done, I found an old reddit thread where a user posed the same question. Though nobody posted any solutions, I did find a crucial piece of info - that bookmark data was stored locally in a folder:

~/Library/Application Support/Microsoft Edge/Default/Bookmarks

Upon inspection of the document, I get a JSON denoting the structure of my bookmarks.

Snippet of bookmarks

On checking the output of export from Brave, I get back a HTML file

Snippet of exported bookmarks

This tells me that I need to transform the JSON into an HTML document in order to be usable for future imports into Brave.

From here, I also found another reddit thread where the user asked about backing up the data from the command line. And that was it - this was the direction I wanted to set towards for my solution. This was when I came across crontab. For those who have never heard of it, crontab is basically a tool that is in-built in Unix OSs that allows for jobs to be scheduled, which is exactly what I needed.

At this point, I knew where I could extract my data, and how I could set up automation for it. The next few questions to be answered were:

  1. How I would actually go about extracting my bookmark data
  2. How I can transform the data into a format that can be imported back into Brave
  3. Where I would backup my data

The answer to my first 2 questions was pretty simple: writing a script in Python would be the most straightforward way to go about it. As for my second question, a conversation I had with a friend last year came to mind. He told me a story of an associate who needed a quick backup of his stuff and his choice of data storage was.... GitHub. It was the free, widely-available, and easy to use. Since I only needed the backup to work for me, it was an easy choice for me too.

At this point, all that was left was to get crontab to run my python scripts to get the data, and upload the data to GitHub. I found an article that contained a sample bash script for doing this, and configured it with crontab to execute at a certain time every day.

Snippet of automated commitsSnippet of automated commits

Now I have peace of mind knowing my bookmarks are safely backed up â˜ș