#!/bin/sh # snapsdel.sh: # delete target system snapshots after "risky procedure". # see ref01/linux/btrfs/snapshots.html # 1 # invoke: # /path/to/scripts/snapsdel.sh yymmdda # | | # | + suffix # | # + current date # # 2022/03/10 Initial version # # set constants # scriptid='snapsdel.sh:' # # verify correct number of arguments passed (1) # if [ $# -ne 1 ] then echo $scriptid Error: argument count not 1 exit 8 fi # echo 'btrfs subv list /' btrfs subv list / echo "btrfs subv delete /home/home_$1" btrfs subv delete /home/home_$1 echo "btrfs subv delete /root_$1" btrfs subv delete /root_$1 echo "btrfs subv delete /machines_$1" btrfs subv delete /machines_$1 echo 'btrfs subv list /' btrfs subv list / exit 0