empty folders in repo_dir/data/ are not automatically removed
Have you checked borgbackup docs, FAQ, and open Github issues?
Yes
Is this a BUG / ISSUE report or a QUESTION?
QUESTION
System information. For client/server mode post info for both machines.
Your borg version (borg -V).
1.2.0
Operating system (distribution) and version.
Distribution: Manjaro Linux Release: 21.3.1 Codename: Ruah
Hardware / network configuration, and filesystems used.
Running a borg Server into a Docker Container with Version 1.2.0
How much data is handled by borg?
------------------------------------------------------------------------------
Original size Compressed size Deduplicated size
All archives: 94.82 GB 71.92 GB 36.81 GB
Unique chunks Total chunks
Chunk index: 208674 530953
Full borg commandline that lead to the problem (leave away excludes and passwords)
borg compact --cleanup-commits
Describe the problem you're observing.
Having into the Borg Repo Data Folder many empty Folders, overall 11 Folders and 7 Folders are empty
Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.
created many Backups over the time and prune the old ones, use Command above and have 7 empty Folders
Question
Can i delete the empty Folders or do borg neat them in any way? Can borg delete this empty folders automatically?
i don't think the empty folders are needed, so if they bother you, you can delete them.
maybe avoid running borg in parallel while you manually delete stuff in the repo - and be careful.
BTW:
- 1.2.1 is out
- only run
borg compact --cleanup-commitsonce after upgrading from 1.1, you should not always run it with--cleanup-commitsas the bug was only present in 1.1.x and was fixed in 1.2.
yeah, deleting the empty dirs automatically is a good idea guess would be a good additional job for borg compact.
What issue am I to resolve here
by compact the repository the old files will be remove and then i had some empty folders
Taking a look at this.
Have looked into the repository module code that deals with compacting. While writing a new segment, when segment_num % self.segments_per_dir is 0, LoggedIO.get_write_fd creates a new directory to place the segment. But these directories are never cleared during the prune/compact process.
I've written a patch that adds a function in LoggedIO to additionally clear empty directories at the end of the compact process.