From 1e4ffd47184b3be0405a859d850f1bf997f2857c Mon Sep 17 00:00:00 2001 From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com> Date: Mon, 5 Jun 2023 23:05:16 +0200 Subject: [PATCH] fix: backup trimming, only selecting zstd file (#846) --- backup/pvc/bin/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup/pvc/bin/run.sh b/backup/pvc/bin/run.sh index 56c2d687..50123d5e 100644 --- a/backup/pvc/bin/run.sh +++ b/backup/pvc/bin/run.sh @@ -11,6 +11,6 @@ do if [[ ! -z "${BACKUP_COUNT}" ]]; then echo "Trimming to only ${BACKUP_COUNT} recent backups in preparation for new backup" #TODO: add the list of exceeding backup before delete - find ${BACKUP_DIR} -maxdepth 1 -name '*.tar.*' -exec basename {} \; | sort -gr | tail -n +$((BACKUP_COUNT +1)) | xargs -I '{}' rm ${BACKUP_DIR}/'{}' + find ${BACKUP_DIR} -maxdepth 1 -name '*.tar.zstd' -exec basename {} \; | sort -gr | tail -n +$((BACKUP_COUNT +1)) | xargs -I '{}' rm ${BACKUP_DIR}/'{}' fi done