# Old backup directory without "stamp file", continue
echo "Found incomplete snapshot in \"$last\", reusing and renaming it ..."
RenameSubvolume "$last" "$sys_target"
# Old backup directory without "stamp file", continue
echo "Found incomplete snapshot in \"$last\", reusing and renaming it ..."
RenameSubvolume "$last" "$sys_target"
[ $ret -eq 24 ] && count_ok_vanished=$count_ok_vanished+1
echo "System \"$system\" completed with status $ret, OK."
[ $ret -eq 24 ] && count_ok_vanished=$count_ok_vanished+1
echo "System \"$system\" completed with status $ret, OK."
# Clean up old generations
declare -i gen_count=$generations+2
to_delete=$(ls -1t "$sys_root" 2>/dev/null | tail -n+$gen_count | sort)
# Clean up old generations
declare -i gen_count=$generations+2
to_delete=$(ls -1t "$sys_root" 2>/dev/null | tail -n+$gen_count | sort)
[ "$DRYRUN" -eq 0 ] \
&& echo "Deleting old backup generations (keep $generations) ..." \
|| echo " *** Trial run, not deleting old generations:"
[ "$DRYRUN" -eq 0 ] \
&& echo "Deleting old backup generations (keep $generations) ..." \
|| echo " *** Trial run, not deleting old generations:"