update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bitlab S3 Backup",
|
||||
"version": "1.0.13",
|
||||
"version": "1.0.14",
|
||||
"slug": "bitlab-s3-backup",
|
||||
"description": "Sync Backups to bitlab S3 storage",
|
||||
"url": "https://git.bitlab.ch/bitlab/ha-addon",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: S3 Backup
|
||||
# ==============================================================================
|
||||
bashio::log.level "debug"
|
||||
bashio::log.level "info"
|
||||
|
||||
|
||||
# script global shortcuts
|
||||
@@ -34,10 +34,11 @@ function delete-s3-backup {
|
||||
for I in `aws s3api list-objects-v2 --bucket "${bucket_name}" --endpoint-url "${custom_endpoint}" --region "${bucket_region}" --query 'Contents[*].Key' --output text`
|
||||
do
|
||||
bashio::log.info "Checking object: $I"
|
||||
TAG=""
|
||||
TAG=`aws s3api get-object-tagging --bucket "${bucket_name}" --endpoint-url "${custom_endpoint}" --region "${bucket_region}" --key "$I" --output text --query "TagSet[?Key=='slug'].Value"`
|
||||
bashio::log.info "Slug for object $I: $TAG"
|
||||
if [ "$TAG" = "$delete_slug" ]; then
|
||||
bashio::log.info "Deleting object: $I"
|
||||
bashio::log.info "Deleting object: $I TAG=$TAG delete_slug=$delete_slug"
|
||||
aws s3api delete-object --bucket "${bucket_name}" --endpoint-url "${custom_endpoint}" --region "${bucket_region}" --key "$I" --output text
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user