Backup with Ubuntu (on ZFS) + sanoid/syncoid on a schedule
Managing Ubuntu backups with Sanoid/Syncoid is simple and can be automated in a crontab!
This is a follow up to Ubuntu 20.04 -> TrueNAS (FreeNAS), ZFS Backup where we set up scheduled backups for an Ubuntu computer.
The backups will be hourly, incremental, and transferred to a NAS running ZFS (such as Truenas).
For handling the automated snapshots and incremental transfers I used sanoid/syncoid which makes automating ZFS tasks easy!
Follow the installation instructions from the repo, and configure your backup schedule in /etc/sanoid/sanoid.conf.
You'll want one backup schedule for each of rpool/USERDATA
, rpool/USERDATA
, and bpool/BOOT
so that you can back up all ZFS pools.
Don't forget that you may need to remove old snapshots with the sanoid configuration (or else you might end up with tens/hundreds of thousands of snapshots). If you need to figure out how to list snapshots, see here, or you can learn how to remove old snapshots manually.
With this configuration, my Ubuntu desktop now regularly backs itself up to my Truenas server. ZFS is amazing in how simple it is to send ZFS snapshots and incremental backups to a NAS. Thank you syncoid and sanoid for simplifying the process further!
2023 Update: I now use ZFS on Ubuntu 22.04. Sanoid is still working great on this installation too.