fix backup removal
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paolo Asperti 2021-09-28 11:46:54 +02:00
parent 014f1f5016
commit 51bbeb82c1
Signed by: paspo
GPG Key ID: 06D46905D19D5182
2 changed files with 2 additions and 2 deletions

View File

@ -43,5 +43,5 @@ FIRST_SLUG_TO_DELETE=$(echo "1 + $NUM_BACKUPS" | bc)
echo $CURRENT_BACKUPS | jq --raw-output ".data.backups | sort_by(.date) | reverse[] | select(.slug != \"$SLUG\") | select (.protected==false) | .slug " | tail -n +$FIRST_SLUG_TO_DELETE | while read SLUG_TO_DELETE echo $CURRENT_BACKUPS | jq --raw-output ".data.backups | sort_by(.date) | reverse[] | select(.slug != \"$SLUG\") | select (.protected==false) | .slug " | tail -n +$FIRST_SLUG_TO_DELETE | while read SLUG_TO_DELETE
do do
echo "Removing backup $SLUG_TO_DELETE" echo "Removing backup $SLUG_TO_DELETE"
curl -s -H "X-HASSIO-KEY: $HASSIO_TOKEN" -X POST http://hassio/backups/$SLUG_TO_DELETE/remove curl -s -H "X-HASSIO-KEY: $HASSIO_TOKEN" -X DELETE http://hassio/backups/$SLUG_TO_DELETE
done done

View File

@ -1,7 +1,7 @@
{ {
"name": "Auto Backup", "name": "Auto Backup",
"url": "https://git.asperti.com/paspo/hassio-addons", "url": "https://git.asperti.com/paspo/hassio-addons",
"version": "0.2.0", "version": "0.2.1",
"slug": "auto-backup", "slug": "auto-backup",
"description": "Take hassio backups with fixed timings and manage retention", "description": "Take hassio backups with fixed timings and manage retention",
"startup": "application", "startup": "application",