Replace cut with sed to get the last two extensions
This commit is contained in:
parent
9f9ef99f1a
commit
1b6946edc3
|
@ -70,7 +70,7 @@ main() { # {{{
|
||||||
# If backup is complete {{{
|
# If backup is complete {{{
|
||||||
if [ "${phase}" = "backup-end" ]; then
|
if [ "${phase}" = "backup-end" ]; then
|
||||||
## Get TARGET's file extension
|
## 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
|
## Set path for LATEST archive file
|
||||||
latest_archive="${dumpdir}/vzdump-${vmtype}-${vmid}-latest.${target_archive_extension}"
|
latest_archive="${dumpdir}/vzdump-${vmtype}-${vmid}-latest.${target_archive_extension}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue