From 03b7ef9d0d150c1a4cbb43eaf3704c6ca2508735 Mon Sep 17 00:00:00 2001 From: Aleck Greenham Date: Sun, 9 Oct 2022 12:44:22 +0100 Subject: [PATCH] Bugfix: S3 database cleanups --- install/assets/functions/10-db-backup | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install/assets/functions/10-db-backup b/install/assets/functions/10-db-backup index daef113..8de2d0b 100755 --- a/install/assets/functions/10-db-backup +++ b/install/assets/functions/10-db-backup @@ -461,7 +461,7 @@ cleanup_old_data() { ;; "s3" | "minio" ) print_info "Cleaning up old backups" - aws ${PARAM_AWS_ENDPOINT_URL} s3 ls s3://${S3_BUCKET}/${S3_PATH} ${s3_ssl} ${s3_ca_cert} ${S3_EXTRA_OPTS} | grep " DIR " -v | while read -r s3_file; do + aws ${PARAM_AWS_ENDPOINT_URL} s3 ls s3://${S3_BUCKET}/${S3_PATH} ${s3_ssl} ${s3_ca_cert} ${S3_EXTRA_OPTS} | grep " DIR " -v | grep " PRE " -v | while read -r s3_file; do s3_createdate=$(echo $s3_file | awk {'print $1" "$2'}) s3_createdate=$(date -d "$s3_createdate" "+%s") s3_olderthan=$(echo $(( $(date +%s)-${DB_CLEANUP_TIME}*60 ))) @@ -800,4 +800,3 @@ EOF fi fi } -