Having had a wee issue with Jellyfin Media Server’s database this week after an upgrade, I decided to avoid the requirement for a 24 hour database rebuild, to start backing things up with Borgmatic. Borgmatic is a handy wrapper script to automate BorgBackup.
# List of source directories to backup.
# Path to BorgBackup repository
# Retention policy for how many backups to keep.
# List of checks to run to validate your backups.
# Custom preparation scripts to run.
- systemctl stop jellyfin
- systemctl start jellyfin
This is a very simple configuration, which does the following steps:
- Stops the Jellyfin server
- Runs Borg on both configuration directories – /etc/jellyfin & /var/lib/jellyfin.
- Checks the repo & existing archives for consistency
- Restarts the Jellyfin server.
Now, whenever the SQLite 🤮 databases backing up the frontend decide to have a shitfit, it should be a relatively simple matter to restore to the last good backup. In my case I have a cronjob set to run every night. Once someone adds proper MySQL support, I will migrate over to a proper database server instance. 😉