fi
fi
- # check if $d is a snapshot of any of the btrbk backups
+ # check if $d is a snapshot of any of the btrbk backups other than the latest
if [[ ! $stale ]]; then
for f in ${snaps[@]}; do
if [[ $f == $last_snap ]]; then continue; fi
if [[ ! $stale ]]; then
last_snap_gen=$(btrfs sub show $last_snap| awk '$1 == "Generation:" {print $2}')
d_gen=$(btrfs sub show $d| awk '$1 == "Generation:" {print $2}')
- if (( last_snap_gen < d_gen )); then
+ if (( d_gen < last_snap_gen )); then
stale=false
else
echo "$d stale: it's generation, $d_gen, is earlier than the last snapshot's, $last_snap_gen"