diff --git a/apps/postgres-logical-backup/entrypoint.sh b/apps/postgres-logical-backup/entrypoint.sh index 20fbe669..1374b34a 100644 --- a/apps/postgres-logical-backup/entrypoint.sh +++ b/apps/postgres-logical-backup/entrypoint.sh @@ -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" != "" ]