ZFS Snapper

Created Friday 31 March 2023



Image copyright

About

I created a script to help manage my ZFS snapshot rotation. I also create manual snapshots along side this script, but like to have an automatic hourly snapshot just in case I forget, but do not want the headache of deleting regular snapshot. There are other ZFS snapshot rotation scripts out there - dare I say more advanced - but I like to control as much as possible my data.

I have allowed users to change how many snapshots you reserve.

How it works

  • Creates snapshot
  • Checks if snapshots need removing; counts all snapshots starting with 'Auto'
  • Deletes all snapshots starting with "Auto" until last n defined remain

Snapshots are named "Auto_YYYYMMDD_HHMMSS"

Click here to view the project on Github.