Skip to content

Commit 03b7ef9

Browse files
committed
Bugfix: S3 database cleanups
1 parent b956bd8 commit 03b7ef9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

install/assets/functions/10-db-backup

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ cleanup_old_data() {
461461
;;
462462
"s3" | "minio" )
463463
print_info "Cleaning up old backups"
464-
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
464+
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
465465
s3_createdate=$(echo $s3_file | awk {'print $1" "$2'})
466466
s3_createdate=$(date -d "$s3_createdate" "+%s")
467467
s3_olderthan=$(echo $(( $(date +%s)-${DB_CLEANUP_TIME}*60 )))
@@ -800,4 +800,3 @@ EOF
800800
fi
801801
fi
802802
}
803-

0 commit comments

Comments
 (0)