Samrat Man Singh

Hi! I’m Samrat, a programmer from Nepal; currently in Bangalore.

Automatic Git backups for your TiddlyWiki data


I recently started using TiddlyWiki and was setting it up on DigitalOcean following Josh Sullivan’s thorough tutorial. One thing the tutorial does not go into is backing up the TiddlyWiki directory.

Here are the steps I followed to set up versioned backups for my TiddliWiki directory.

Setting up the tools

Starting the gitwatch service

   ExecStart=bash /usr/local/bin/gitwatch -s 30 -r origin "%I"

I pass -s 30 so that commits are only made at most once every 30 seconds. The -r origin sets the remote to push to.

I also add a Restart=always line in the [Service] section, just in case the gitwatch service itself crashes.

systemctl --user enable gitwatch@$(systemd-escape /your/tiddly/dir).service
systemctl --user start gitwatch@$(systemd-escape /your/tiddly/dir).service

Make changes to your TiddlyWiki, and check that the service is working:

systemctl --user status gitwatch@$(systemd-escape /your/tiddly/dir).service

You’ll also want to check the Github repo to see that your changes got pushed.

If you’re using TiddlyWiki’s basic authentication mechanism(which reads usernames/passwords from a CSV file), you’ll probably want to add the CSV file to the repository’s .gitignore.