danielwelch / hassio-dropbox-sync

Back up your Hass.io snapshots and other local files to Dropbox
Apache License 2.0
132 stars 37 forks source link

No longer respecting the retain #50

Open picotrain77 opened 2 years ago

picotrain77 commented 2 years ago

Hi I am not sure if this is maintained anymore, but its still working correctly other than I have noticed that it is no longer respecting the retain number of backups.

I see in the logs this:

[Info] keep_last option is set, cleaning up files...
Traceback (most recent call last):
  File "/keep_last.py", line 47, in <module>
    main(args.number)
  File "/keep_last.py", line 15, in main
    snapshot_info.raise_for_status()
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 939, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://hassio/snapshots

I assume this issue started to occur when snapshots were renamed to backups. I have no idea how I can change this myself, although I have looked at the code.

Any ideas appreciated. TIA

matthewhadley commented 2 years ago

I was using this Add-on but it recently stopped working due to it not supporting the use of short lived tokens that Dropbox moved to.

I’ve developed my own Add-on to replace it: https://github.com/matthewhadley/homeassistant-dropback/blob/master/dropback/DOCS.md

picotrain77 commented 2 years ago

Hi Mathew, that’s for this, mine is still currently working but as it no longer maintains the number of backups held on the HA server it’s becoming a pain as I make partial backups every day and remembering to manually delete them regularly feels kind of counter intuitive.

Will give your add-on a go, code looks clean, thanks for sharing, impressive CV by the way 😉

matthewhadley commented 2 years ago

I suspect you have a long lived token generated before Dropbox moved away from that approach (https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens).

I found the same as you that backup clearing had stopped and maybe I reinstalled the add on, to then find it then would no longer successfully upload after about 4 hours.