Skip to content

Automatically free up backup storage space - #260

Merged
MarkZH merged 18 commits into
mainfrom
free-up-auto
Jul 20, 2026
Merged

MarkZH merged 18 commits into
mainfrom
free-up-auto

Conversation

@MarkZH

@MarkZH MarkZH commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Instead of keeping a constant amount of space free on the backup media, use --free-up auto to only delete old backups when a backup fails due to running out of space.

Closes #235

@MarkZH

MarkZH commented Jul 9, 2026

Copy link
Copy Markdown
Owner Author

Instead of doing calculations, just delete the oldest backup (taking care to not delete the latest) and restart the backup cycle. DONE

@MarkZH

MarkZH commented Jul 9, 2026

Copy link
Copy Markdown
Owner Author

Fix folder_size(): only count hard linked files once. Make inode_sizes: dict[int, int] of inodes -> size and return sum(inode_sizes.values()). DONE

@MarkZH

MarkZH commented Jul 9, 2026

Copy link
Copy Markdown
Owner Author

Delete unique_folder_size(). DONE

MarkZH added 4 commits July 8, 2026 20:53
Instead of complicated calculations, just delete the oldest backup when
using --free-up auto.
Found program bug where no new backups would be made after running out
of space. This was due to a logic error in the except branch that
prevented the --free-up auto logic from running.
@MarkZH
MarkZH marked this pull request as ready for review July 9, 2026 04:33
@MarkZH
MarkZH marked this pull request as draft July 9, 2026 21:34
@MarkZH

MarkZH commented Jul 9, 2026

Copy link
Copy Markdown
Owner Author

DONE - using combination of options 2 and 3

Adjust args.max_deletions after deleting oldest backup. If args.max_deletions == 0, set auto_free_up = False.

-- OR --

Go back to adjusting the --free-up parameter so all deletion logic is centralized in delete_old_backups(args).

-- OR --

Add hidden argument to argument parser (--delete-oldest) and add it to args in the exception branch.

@MarkZH

MarkZH commented Jul 10, 2026

Copy link
Copy Markdown
Owner Author

Add tests for delete_oldest_backup(). DONE

MarkZH and others added 5 commits July 9, 2026 22:11
- Restarting backup after running out of space
- Free space after deleting staging folder
- Blank lines between operations
@MarkZH
MarkZH marked this pull request as ready for review July 15, 2026 19:58
@MarkZH
MarkZH merged commit 82cc9c7 into main Jul 20, 2026
6 checks passed
@MarkZH
MarkZH deleted the free-up-auto branch July 20, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--free-space auto

1 participant