[Bug]: Backups is not respecting "Numbers of backups to keep" number #676

Closed
opened 2026-04-24 23:16:43 +02:00 by adam · 3 comments
Owner

Originally created by @TeroKeso on GitHub (Oct 4, 2022).

Describe the issue

Backups is not respecting "Numbers of backups to keep" number. Maximum backups to keep (in GB) is working and removing older backups when making new versions.

image

INFO
[BackupManager] 45 Backups Found
DEBUG
[BackupManager] Removing old backup 2022-08-19T0100
2022-10-03 13:01:59
DEBUG
[BackupManager] Removing Backup "/metadata/backups/2022-08-19T0100.audiobookshelf"
2022-10-03 13:01:59
INFO
[BackupManager] Backup "2022-08-19T0100" Removed
"2022-10-03 13:03:11
DEBUG
[BackupManager] Removing old backup 2022-08-20T0100
2022-10-03 13:03:11
DEBUG
[BackupManager] Removing Backup "/metadata/backups/2022-08-20T0100.audiobookshelf""

Steps to reproduce the issue

  1. Activate Backups
  2. Keep defaults
  3. Create Backups button.

Audiobookshelf version

2.2.0

How are you running audiobookshelf?

Docker

Originally created by @TeroKeso on GitHub (Oct 4, 2022). ### Describe the issue Backups is not respecting "Numbers of backups to keep" number. Maximum backups to keep (in GB) is working and removing older backups when making new versions. ![image](https://user-images.githubusercontent.com/29271631/193800095-3aa90c7c-704a-4d75-9b70-6f77155df199.png) INFO [BackupManager] 45 Backups Found DEBUG [BackupManager] Removing old backup 2022-08-19T0100 2022-10-03 13:01:59 DEBUG [BackupManager] Removing Backup "/metadata/backups/2022-08-19T0100.audiobookshelf" 2022-10-03 13:01:59 INFO [BackupManager] Backup "2022-08-19T0100" Removed "2022-10-03 13:03:11 DEBUG [BackupManager] Removing old backup 2022-08-20T0100 2022-10-03 13:03:11 DEBUG [BackupManager] Removing Backup "/metadata/backups/2022-08-20T0100.audiobookshelf"" ### Steps to reproduce the issue 1. Activate Backups 2. Keep defaults 3. Create Backups button. ### Audiobookshelf version 2.2.0 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:16:43 +02:00
adam closed this issue 2026-04-24 23:16:43 +02:00
Author
Owner

@advplyr commented on GitHub (Oct 4, 2022):

This is only removing 1 backup for every 1 backup that is added if the number of backups exceeds the max you set.
So if you set the max number of backups to 5 when you already had 10 backups then you will always have 10 backups. I don't remember exactly why I implemented it this way but I suppose it could be updated to loop through and remove all the ones exceeding the max.
Am I right in suggesting that you set the max to 5 after you already had more then 5?

@advplyr commented on GitHub (Oct 4, 2022): This is only removing 1 backup for every 1 backup that is added if the number of backups exceeds the max you set. So if you set the max number of backups to 5 when you already had 10 backups then you will always have 10 backups. I don't remember exactly why I implemented it this way but I suppose it could be updated to loop through and remove all the ones exceeding the max. Am I right in suggesting that you set the max to 5 after you already had more then 5?
Author
Owner

@TeroKeso commented on GitHub (Oct 5, 2022):

i have been running software from early days. Did not change the defaults because I am backupping server regularly. I just activated log time past versions it and have it be. I did notice slow size growth server backups and I did find this. After removing extra backups it is working with the default values.

In long run I think this is a good compromise for data preservation. Maybe a notification in the page that it will not remove old backups if changed.

@TeroKeso commented on GitHub (Oct 5, 2022): i have been running software from early days. Did not change the defaults because I am backupping server regularly. I just activated log time past versions it and have it be. I did notice slow size growth server backups and I did find this. After removing extra backups it is working with the default values. In long run I think this is a good compromise for data preservation. Maybe a notification in the page that it will not remove old backups if changed.
Author
Owner

@advplyr commented on GitHub (Oct 9, 2022):

Added a tooltip explaining this in v2.2.1

@advplyr commented on GitHub (Oct 9, 2022): Added a tooltip explaining this in [v2.2.1](https://github.com/advplyr/audiobookshelf/releases/tag/v2.2.1)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#676