Fix keeping files on Amazon s3

This commit is contained in:
Jan Stodola 2019-04-04 13:59:45 +02:00 committed by Alexander Todorov
parent db7b1e4fcd
commit b57de93468

View File

@ -172,7 +172,7 @@ done
if [ "$creation_date" \< "$TIMESTAMP" ]; then if [ "$creation_date" \< "$TIMESTAMP" ]; then
# find and delete s3 objects without the "keep_me" tag # find and delete s3 objects without the "keep_me" tag
keep=$(aws s3api get-object-tagging --bucket ${AWS_BUCKET} --key ${filename_f} --output text | cut -f2 | grep "^keep_me$") keep=$(aws s3api get-object-tagging --bucket ${AWS_BUCKET} --key ${filename_f} --output text | cut -f2 | grep "^keep_me$")
if [ -n "$keep" ]; then if [ -z "$keep" ]; then
rlLogInfo "Removing old file $filename_f created $date_f $time_f" rlLogInfo "Removing old file $filename_f created $date_f $time_f"
rlRun -t -c "aws s3 rm s3://${AWS_BUCKET}/${filename_f}" rlRun -t -c "aws s3 rm s3://${AWS_BUCKET}/${filename_f}"
fi fi