From 1b6946edc3d49e350591ab7f6ef1cc1d393d4d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Mon, 7 Feb 2022 14:56:21 +0100 Subject: [PATCH] Replace cut with sed to get the last two extensions --- proxmox/vzdump-hook-hardlink-latest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxmox/vzdump-hook-hardlink-latest.sh b/proxmox/vzdump-hook-hardlink-latest.sh index 9fd8b34..b496f9f 100755 --- a/proxmox/vzdump-hook-hardlink-latest.sh +++ b/proxmox/vzdump-hook-hardlink-latest.sh @@ -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}"