This commit is contained in:
2024-04-03 14:22:04 +02:00
parent 7d12e3155f
commit fbe298c0a9
2 changed files with 3 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "bitlab S3 Backup", "name": "bitlab S3 Backup",
"version": "1.0.11", "version": "1.0.12",
"slug": "bitlab-s3-backup", "slug": "bitlab-s3-backup",
"description": "Sync Backups to bitlab S3 storage", "description": "Sync Backups to bitlab S3 storage",
"url": "https://git.bitlab.ch/bitlab/ha-addon", "url": "https://git.bitlab.ch/bitlab/ha-addon",

View File

@@ -62,11 +62,11 @@ bashio::log.debug "Using AWS CLI version: '$(aws --version)'"
bashio::log.debug "Command: 'aws s3 sync $monitor_path s3://$bucket_name/ --no-progress --region $bucket_region'" bashio::log.debug "Command: 'aws s3 sync $monitor_path s3://$bucket_name/ --no-progress --region $bucket_region'"
bashio::log.debug "SLUG: $SLUG $BACKUP_NAME" bashio::log.debug "SLUG: $SLUG $BACKUP_NAME"
bashio::log.debug '{"TagSet": [{ "Key": "slug", "Value": "${SLUG}" }]}' bashio::log.debug "{\"TagSet\": [{ \"Key\": \"slug\", \"Value\": \"${SLUG}\" }]}"
aws s3 cp "/backup/${SLUG}.tar" "s3://${bucket_name}/${BACKUP_NAME}.tar" --endpoint-url "${custom_endpoint}" --region "${bucket_region}" --no-progress aws s3 cp "/backup/${SLUG}.tar" "s3://${bucket_name}/${BACKUP_NAME}.tar" --endpoint-url "${custom_endpoint}" --region "${bucket_region}" --no-progress
aws s3api put-object-tagging --bucket "${bucket_name}" --key "${BACKUP_NAME}.tar" --tagging '{"TagSet": [{ "Key": "slug", "Value": "${SLUG}" }]}' --endpoint-url "${custom_endpoint}" --region "${bucket_region}" aws s3api put-object-tagging --bucket "${bucket_name}" --key "${BACKUP_NAME}.tar" --tagging "{\"TagSet\": [{ \"Key\": \"slug\", \"Value\": \"${SLUG}\" }]}" --endpoint-url "${custom_endpoint}" --region "${bucket_region}"
if bashio::var.true "${delete_local_backups}"; then if bashio::var.true "${delete_local_backups}"; then
bashio::log.info "Will delete all the oldest local backups except the '${local_backups_to_keep}' newest ones." bashio::log.info "Will delete all the oldest local backups except the '${local_backups_to_keep}' newest ones."