#!/bin/sh # snapscre.sh: # create target system snapshots before "risky procedure". # see ref01/linux/btrfs/snapshots.html # 1 # invoke: # /path/to/scripts/snapscre.sh yymmdda # | | # | + suffix # | # + current date # # 2022/03/10 Initial version # # set constants # scriptid='snapscre.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 snapshot -r /home /home/home_$1" btrfs subv snapshot -r /home /home/home_$1 echo "btrfs subv snapshot -r / /root_$1" btrfs subv snapshot -r / /root_$1 echo "btrfs subv snapshot -r /var/lib/machines /machines_$1" btrfs subv snapshot -r /var/lib/machines /machines_$1 echo 'btrfs subv list /' btrfs subv list / exit 0