Repository navigation
Disabled backup location still has retention policy applied #98
|
I recently ran into some unexpected behavior with Home Assistant's backup retention settings that I think could benefit from some clarification in the UI. I'm curious whether this is working as intended, because it wasn't immediately obvious to me how the different settings interact. I have Home Assistant configured to retain the three most recent automatic backups locally. I also have a UGREEN NAS configured as an additional backup location in HA, but that location is disabled in the automatic backup configuration. Instead of having HA write backups directly to the NAS, I use a separate Linux server to copy completed backups from HA to the NAS, validate the archives, and independently retain the five most recent backups, due to the size of the backups. My goals is: HA manages three local backups, while the external process maintains five on the NAS. While reviewing my backup monitoring dashboard, I noticed that the NAS consistently contained the same three backups as HA, despite my external backup process being configured to retain five. Initially, I suspected an issue with my backup management script, so I reviewed its code and logs. I confirmed that it wasn't deleting any archives and hadn't executed during the periods when older backups disappeared from the NAS. To investigate further, I created another automatic backup in HA and monitored both storage locations. Once the backup completed, HA removed its oldest local backup, as expected. However, the corresponding archive also disappeared from the NAS, even though that destination was disabled in HA's backup configuration. After looking more closely at the settings, I found that the disabled NAS location still had its retention policy configured to "Use global settings." Apparently, disabling a backup location prevents new default backups from being created there, but doesn't disable retention management for backups already stored at that location. I changed the NAS location's retention setting from "Use global settings" to "Forever" and repeated the test. This time, HA removed its oldest local backup, but the corresponding NAS archive remained intact. That seems to confirm that the retention policy was responsible for the unexpected deletions. The backup configuration page currently states:
Each location also has an ON/OFF toggle. My interpretation was that disabling a location would exclude it from automatic backup management, including retention. I didn't realize that retention would continue operating independently of whether the location was enabled for new backups. The retention settings are accessible through the gear icon next to each location, but there isn't anything indicating that these settings remain active even when the location itself is disabled. I can understand why backup creation and retention might be managed separately. That flexibility could certainly be useful. However, since retention involves deleting existing archives, I think it would be helpful to make that distinction more apparent. For example, a short explanation might be sufficient:
Alternatively, the UI could provide some indication when a disabled location still has an active retention policy. In my case, the behavior resulted in older NAS backup archives being deleted even though I was intentionally managing that destination through a separate process. Fortunately, my backup monitoring helped identify the discrepancy, and changing the retention setting to "Forever" appears to have resolved it. I don't necessarily think the underlying functionality needs to change. It may simply be a matter of making the relationship between backup destinations and retention settings clearer. Is this the intended behavior, and would it make sense to clarify it in the backup configuration UI? |
Replies: 1 comment
|
Thanks for the clear write-up. I checked the code with Claude and can confirm it works like this. I see it as a UX issue: when a location is switched off, retention should follow the toggle and leave it alone. I've opened a PR to change this: home-assistant/core#192788 |
Thanks for the clear write-up.
I checked the code with Claude and can confirm it works like this. I see it as a UX issue: when a location is switched off, retention should follow the toggle and leave it alone.
I've opened a PR to change this: home-assistant/core#192788