Replace cut with sed to get the last two extensions

This commit is contained in:
Jeremy Gardais 2022-02-07 14:56:21 +01:00
parent 9f9ef99f1a
commit 1b6946edc3
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ main() { # {{{
# If backup is complete {{{
if [ "${phase}" = "backup-end" ]; then
## Get TARGET's file extension
target_archive_extension="$(printf '%s' "${TARGET}" | cut --delimiter="." --fields=1 --complement)"
target_archive_extension="$(printf '%s' "${TARGET}" | sed -n "s/.*\.\([[:alnum:]]*\.[[:alnum:]]*\)$/\1/p")"
## Set path for LATEST archive file
latest_archive="${dumpdir}/vzdump-${vmtype}-${vmid}-latest.${target_archive_extension}"