zfs rollback script
So, zfs is awesome (not going to get into that in this post)...and I love automation, so I set out to join the two together. 🙂️
I found the script below here: https://blog.woopi.org/wordpress/?p=60
I left all my revision history in the gist so you know what I altered, and below is the commands that I would normally run with this script:
# identify which snapshot I want to revert to zfs list -t snapshot -r rpool | less # templated command curl -fsSL 'https://git.io/JtVB4' | sudo bash -s '<pool_name>' '<pool_snapshot_name>' '<home_dir_zpool_name>' |& tee "zfs-roleback_$(date -I).log" # actual command I ran curl -fsSL 'https://git.io/JtVB4' | sudo bash -s 'rpool' 'zfs-auto-snap_daily-2020-07-09-1137' 'elbruto' |& tee "zfs-roleback_$(date -I).log"
pairing this with zfs-auto-snapshot has been awesome!
On ubuntu if you just
sudo apt install zfs-auto-snapshot it just works and handles the zfs snapshot for you 😁️