+ continue
+ fi
+
+ # todo: decipher /mnt/root, like we do in check-subvol-stale
+ cd /mnt/root
+ if [[ -e $vol ]]; then
+ e mv $vol $vol.leaf.$(date +%Y-%m-%dT%H:%M:%S%z)
+ leaf_vols=($vol.leaf.*)
+ for leaf in ${leaf_vols[@]}; do
+ leaf_secs=$(date -d ${leaf#$vol.leaf.} +%s)
+ if (( $(date +%s) - 60*60*24*60 > leaf_secs )); then # 60 days
+ e btrfs sub del $leaf
+ fi
+ done
+ fi
+ # Note, we make a few assumptions in this script, like
+ # $d was not a different subvol id than $vol, and
+ # things otherwise didn't get mounted very strangely.
+ e btrfs sub snapshot $fresh_snap $vol
+ for dir in $d ${binds[@]}; do
+ e mnt $dir
+ done
+ stale_dir=/nocow/btrfs-stale
+ rm -f $stale_dir/$d