Files
coredesktop/updates.d/09-snapshot.sh
T
2026-10-21 08:33:19 -06:00

16 lines
452 B
Bash

#!/bin/bash
# Snapshot / before the system update so a bad upgrade can be rolled back.
# system/snapper.sh creates the "root" config on btrfs machines and keeps the
# last 5 snapshots.
is_installed() {
command -v snapper &>/dev/null && [ -f /etc/snapper/configs/root ]
}
run_update() {
echo "Snapshotting / before updating..."
sudo snapper -c root create -c number -d "Before CoreDesktop update" \
&& sudo snapper -c root cleanup number
}