Skip to content

Commit

Permalink
fix(postgres-logical-backup): fix DELETE_OLDER_THAN support
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgon committed Nov 25, 2023
1 parent db96624 commit b00d132
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/postgres-logical-backup/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ if [ -n "${DELETE_OLDER_THAN}" ]; then
# shellcheck disable=SC2086
aws ${AWS_ARGS} s3 ls "s3://${S3_BUCKET}/${S3_PREFIX}/" | grep " PRE " -v | while read -r line;
do
fileName=$(echo "$line"|awk "{'print \$4'}")
created=$(echo "$line"|awk "{'print \$1\" \"\$2'}")
created=$(date -d "$created" +%s)
older_than=$(date -d "$DELETE_OLDER_THAN" +%s)
fileName="$(echo $line|awk '{ print $4 }')"
created="$(echo $line|awk '{ print $1 " " $2 }')"
created="$(date -d "$created" +%s)"
older_than="$(date -d "$DELETE_OLDER_THAN" +%s)"
if [ "$created" -lt "$older_than" ]
then
if [ "$fileName" != "" ]
Expand Down

0 comments on commit b00d132

Please sign in to comment.