ZFS Pool "Checkpoints": They work just like seatbelts! (Not really)

If anyone is wondering, I have been using this single-line Cron Job on my TrueNAS Core 13.3 server:


Cron Job
Description: Daily checkpoint for my pool
Command: zpool checkpoint -d -w mypool; zpool checkpoint mypool
Run As: root
Schedule: 0 3 * * * (03:00 every day)


What this does is create a new checkpoint daily at 03:00. This means that I will never sit on a checkpoint for more than 24 hours, while hopefully giving me enough time to “use” a checkpoint if something goes wrong. (As long as I “rewind” the pool or disable the Cron Job before the next time the clock hits 03:00. Otherwise, the Cron Job will replace the good checkpoint with a new checkpoint after the mistake was made.)

The -w flag is important for the Cron Job, since you want the first half of the command to “exit” only after it finishes discarding the checkpoint. The semicolon is also important, since you want them to run one after the other, even if the first half “fails” because “no checkpoint currently exists”.

1 Like