[[ $EUID == 0 ]] || exec sudo -E "$this_file" "$@"
set -e; . /usr/local/lib/bash-bear; set +e
+shopt -s nullglob
usage() {
cat <<EOF
if (( $# )); then
all_vols=( "$@" )
else
- all_vols=(q a o i ar qd qr)
+ all_vols=(q a o i qd qr)
+ ar_snaps=(/mnt/root/btrbk/ar.*)
+ if [[ -e /mnt/root/ar ]] || (( ${#ar_snaps[@]} > 0 )); then
+ all_vols+=(ar)
+ fi
fi
##### end command line parsing ########
$crypt_dev /a btrfs noatime,subvol=a$mopts 0 0
EOF
-shopt -s nullglob
# ssh and probably some other things care about parent directory
# ownership, and ssh doesn\'t allow any group writable parent
fa=(/mnt/o/btrbk/o.*); f=${fa[0]}
if [[ -e $f ]]; then
if [[ $o_dev != "$root_dev" ]]; then
+ # ,compress=zstd regardless of mopts since these are all text files
+ # and it cuts disk use by about half.
fstab <<EOF
-$o_dev /o btrfs noatime,subvol=o$mopts 0 0
+$o_dev /o btrfs noatime,subvol=o${mopts/,compress=zstd/},compress=zstd 0 0
EOF
fi
fstab <<EOF