mirror of
https://github.com/garraflavatra/docker-volume-s3-backup.git
synced 2025-05-17 13:14:38 +00:00
fix S3_ENDPOINT and BACKUP_KEEP_DAYS compatibility (#19)
This commit is contained in:
parent
4ac3278ffb
commit
d5a7945317
@ -90,11 +90,11 @@ if [ -n "$BACKUP_KEEP_DAYS" ]; then
|
|||||||
backups_query="Contents[?LastModified<='${date_from_remove} 00:00:00'].{Key: Key}"
|
backups_query="Contents[?LastModified<='${date_from_remove} 00:00:00'].{Key: Key}"
|
||||||
|
|
||||||
echo "Removing old backup from $S3_BUCKET..."
|
echo "Removing old backup from $S3_BUCKET..."
|
||||||
aws s3api list-objects \
|
aws $aws_args s3api list-objects \
|
||||||
--bucket "${S3_BUCKET}" \
|
--bucket "${S3_BUCKET}" \
|
||||||
--prefix "${S3_PREFIX}" \
|
--prefix "${S3_PREFIX}" \
|
||||||
--query "${backups_query}" \
|
--query "${backups_query}" \
|
||||||
--output text \
|
--output text \
|
||||||
| xargs -n1 -t -I 'KEY' aws s3 rm s3://"${S3_BUCKET}"/'KEY'
|
| xargs -n1 -t -I 'KEY' aws $aws_args s3 rm s3://"${S3_BUCKET}"/'KEY'
|
||||||
echo "Removing complete."
|
echo "Removing complete."
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user