hass-auto-backup icon indicating copy to clipboard operation
hass-auto-backup copied to clipboard

Counter for Backups under Monitoring

Open ChristophCaina opened this issue 4 years ago • 3 comments

Hi, I have configured AutoBackup on my HomeAssistant installation to create backups manually (from the Dashboard) or automated in a maintenance job.

This is working well so far...

BUT: With each Backup created, the Counter "Backups under monitoring" will be increased. That's ok - so far... Except: if I delete one of the created (and monitored) backups manually in Supervisor.

It seems, that this does not affect the counter for AutoBackup - and I guess, this could lead to issues later, when AutoBackup is trying to purge one of the monitored (but missing) backups?

Is there a way to tell AutoBackup, that it should check, if a Monitored Backup is still existiting? And if not - that it will decrease the counter accordingly?

Thanks

ChristophCaina avatar Sep 10 '21 10:09 ChristophCaina

Actually, that's semi-intensional, realistically backups that Auto Backup is monitoring should be getting deleted by Auto Backup itself, if you choose to delete it via the Supervisor Auto Backup will still "monitor" it and when it tries to delete the backup if it's present or missing it will be un-monitored. There may be some better ways to handle this, I'll have a look into it.

TDLR: nothing bad will happen the counter will just show the backup until it expires and Auto Backup tries to delete it.

jcwillox avatar Sep 11 '21 00:09 jcwillox

Curious to know where Auto Backup is keeping track of these old backups. This was pretty confusing for me when setting up generational backups since at one point during my testing the monitored backup count began to diverge from my actual backups.

Even when I manually delete all backups, remove the integration, and uninstall from HACS entirely, I still see the old count after reinstalling within sensor.auto_backup. I'd be happy with a "nuke it all" option and start fresh, but I figured the steps I took would have taken care of that.

prenetic avatar May 20 '22 20:05 prenetic

The information is stored in /config/.storage/auto_backup.snapshots_expiry you could delete that file to reset the monitored backups.

As I mentioned before, if you manually delete backups they will continue to be "monitored" until Auto Backup tries to delete it at which point it realises that it was already deleted and moves on.

Auto Backup should just poll the supervisor occasionally to check if any of its monitored backups have been deleted, I'll open a feature request for it.

jcwillox avatar May 22 '22 03:05 jcwillox