- full_base=$mountp/$base
- existing=( $full_base-* )
- if [[ -e ${existing[0]} ]]; then
- snapshot=$full_base-$(( ${#existing[@]} + 1 ))
+ date_path=${mountp%/*}/$date
+ todays=( $date_path-* )
+ IFS=$'\n' todays=($(sort -Vr <<<"${todays[*]}")); unset IFS
+ if [[ -e ${todays[0]} ]]; then
+ snapshot=$date_path-$(( ${todays[0]##*-} + 1 ))