borgbackupserver icon indicating copy to clipboard operation
borgbackupserver copied to clipboard

Prune deletes all backup archives despite retention policy

Open theborg72 opened this issue 8 months ago • 2 comments

After upgrading Borg Backup Server to v2.17.7, prune removes all backup archives immediately after the backup job finishes.

•	Backup job runs once per day
•	Prune job runs right after the backup
•	Retention policy:
•	Daily: 7
•	Weekly: 2
•	Monthly: 1
•	Hourly: 0

Prune Mar 15 5:25pm PostgreSQL-Storage-1 · -- Backup Mar 15 5:24pm PostgreSQL-Storage-1 · 9 files · 16s Prune Mar 15 10:01am PostgreSQL-Storage-1 · -- Backup Mar 15 10:00am PostgreSQL-Storage-1 · 9 files · 17s Update_borg Mar 15 4:00am · 2s Prune Mar 14 10:01am PostgreSQL-Storage-1 · 1s Backup Mar 14 10:00am PostgreSQL-Storage-1 · 9 files · 17s Update_borg Mar 14 4:00am · 2s Compact Mar 14 3:01am PostgreSQL-Storage-1 · --

theborg72 avatar Mar 15 '26 16:03 theborg72

It seems the path was wrong in the prune function.

In my docker-compose.yml I had:

- ./bbs:/var/bbs
- /mnt/nas:/nas

After I changed the path and mounted it under /var/bbs, which seems to be a requirement:

- ./bbs:/var/bbs
- /mnt/nas:/var/bbs/nas

After that change the jobs were kept and prune no longer removed them.

theborg72 avatar Mar 15 '26 17:03 theborg72

Thanks for following up with the root cause! You're right — this was a volume mount path issue, not a bug in BBS or borg prune.

Borg needs the repository path inside the container to match what's stored in the BBS database. Mounting the NAS at /nas instead of under /var/bbs/ meant borg prune couldn't resolve the repo correctly, so it saw no matching archives and pruned everything.

Your fix (mounting at /var/bbs/nas) is the correct approach. Closing as resolved — glad you got it sorted!

marcpope avatar Mar 16 '26 07:03 marcpope