Skip to content

Commit

Permalink
store backup info
Browse files Browse the repository at this point in the history
  • Loading branch information
wozz committed Dec 16, 2023
1 parent 2a24c36 commit 88c2b76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion amazon-s3-backup/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "S3 Backup",
"version": "1.0.5",
"version": "1.1.0",
"slug": "s3-backup",
"description": "Sync Backups to your S3 bucket",
"url": "https://github.com/wozz/ha-addons/tree/main/amazon-s3-backup",
Expand Down
5 changes: 5 additions & 0 deletions amazon-s3-backup/rootfs/etc/services.d/amazon-s3-backup/run
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ curl -s -H "Authorization: Bearer $SUPERVISOR_TOKEN" supervisor/backups | jq -r
'.data.backups[] | select(.date[0:19] | strptime("%Y-%m-%dT%H:%M:%S") | mktime > now-86400) | select(.location != null) | .slug' | \
xargs -n1 -I% sh -c 'curl -s -H "Authorization: Bearer $SUPERVISOR_TOKEN" supervisor/backups/%/download | aws s3 cp --endpoint-url $custom_endpoint - s3:https://$bucket_name/%.tar'

# save backup info to file
curl -s -H "Authorization: Bearer $SUPERVISOR_TOKEN" supervisor/backups | jq -r \
'.data.backups[] | select(.date[0:19] | strptime("%Y-%m-%dT%H:%M:%S") | mktime > now-86400) | select(.location != null) | .slug' | \
xargs -n1 -I% sh -c 'curl -s -H "Authorization: Bearer $SUPERVISOR_TOKEN" supervisor/backups/%/info | aws s3 cp --endpoint-url $custom_endpoint - s3:https://$bucket_name/%.info'

bashio::log.info "Finished S3 Backup."

0 comments on commit 88c2b76

Please sign in to comment.