Files
sysconfig/devices/teal/config/usr/local/bin/appdata-backup-cleanup.sh
T
2026-10-21 08:51:20 -04:00

14 lines
426 B
Bash

#!/bin/bash
if [ -f /run/appdata_active_snapshot.txt ]; then
SNAPSHOT_NAME=$(cat /run/appdata_active_snapshot.txt)
# Unmount and clean up scratch directory
umount -R /mnt/appdata-scratch || true
rmdir /mnt/appdata-scratch || true
# Destroy the recursive snapshot tree across all appdata datasets
zfs destroy -r tank/appdata@"$SNAPSHOT_NAME"
rm -f /run/appdata_active_snapshot.txt
fi