From 36890de7f42aa328ce7d74443c6ca2479c3d2683 Mon Sep 17 00:00:00 2001 From: Florian Lindner Date: Mon, 15 Jun 2020 07:28:42 +0200 Subject: [PATCH] Make delete-days delete only files with mailcow-* in backup location (#3609) Co-authored-by: Florian Lindner --- helper-scripts/backup_and_restore.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper-scripts/backup_and_restore.sh b/helper-scripts/backup_and_restore.sh index 0179cea5..9f8b970d 100755 --- a/helper-scripts/backup_and_restore.sh +++ b/helper-scripts/backup_and_restore.sh @@ -130,7 +130,7 @@ function backup() { --delete-days) shift if [[ "${1}" =~ ^[0-9]+$ ]]; then - find ${BACKUP_LOCATION}/* -maxdepth 0 -mmin +$((${1}*60*24)) -exec rm -rvf {} \; + find ${BACKUP_LOCATION}/mailcow-* -maxdepth 0 -mmin +$((${1}*60*24)) -exec rm -rvf {} \; else echo "Parameter of --delete-days is not a number." fi