X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=check-subvol-stale;h=dcc0535e6df227cc3b5b03f56a8a543b8df4eeb3;hp=6a63124cd3ac749028a794117e0da2df384dbcfd;hb=a7f9b883055cb1c4056469d498c7bc6564670c37;hpb=3e7b531da29ec85071b9ea63adc2615e2211cb0d diff --git a/check-subvol-stale b/check-subvol-stale index 6a63124..dcc0535 100644 --- a/check-subvol-stale +++ b/check-subvol-stale @@ -28,7 +28,7 @@ usage: $0 SUBVOL_MOUNTPOINT... In git this is not not executable because it's meant to be installed using ./install-my-scripts -If latest subvols \$@ are not mounted, exit 1, print message, and print +If latest subvols \$@ are not mounted, print a message, and print the unstale subvol name into /nocow/btrfs-stale/\$subvol Fresh is opposite of stale. To be fresh, either SUBVOL_MOUNTPOINT is a @@ -67,7 +67,6 @@ stale-file() { if $stale; then mkdir -p $stale_dir printf "%s\n" $freshest_snap > $stale_file - ret=1 else rm -f $stale_file fi @@ -79,7 +78,6 @@ d() { fi } -ret=0 for d; do vol=${d##*/} # second field, non-comment line == $d @@ -134,9 +132,8 @@ for d; do ) if [[ ! $last_snap ]]; then # should not happen. - echo "$0: error: could not find latest snapshot for $svp among ${snaps[*]}" - ret=1 - continue + echo "$0: error: could not find latest snapshot for $svp among ${snaps[*]}" >&2 + exit 1 fi if [[ ! -e $svp ]]; then @@ -181,6 +178,4 @@ for d; do fi stale-file - done -exit $ret