Skip to content

Additional show option#2480

Open
arcsinhx wants to merge 3 commits into
bit-team:devfrom
arcsinhx:additional-show-option
Open

Additional show option#2480
arcsinhx wants to merge 3 commits into
bit-team:devfrom
arcsinhx:additional-show-option

Conversation

@arcsinhx
Copy link
Copy Markdown

Summary

Add a new --usage option to the show subcommand to display the total physical disk usage of all backups in a profile. It appends a "Total disk usage" line above the existing backup listing, showing the total physical disk consumption of all backups in the profile, correctly accounting for hard links. Physical disk usage is calculated via a single du -sbc call across all snapshot directories. The --last option with --usage will lead to show the disk usage of the last backup(including the hard link targeted file)

First contribution introduction

I'm a undergraduate user who used backintime for about two months. And I found that each time searching the profile path and look its disk usage is a little trouble, so I add a --usage option for show subcommand to avoid these redundant steps.

@buhtz
Copy link
Copy Markdown
Member

buhtz commented May 11, 2026

Hello arcsinhx,

On behalf of the team, thank you for your contribution and taking the time to improve Back In Time. We appreciate it.

This looks like a fine and high-quality PR. Your PR will be reviewed as soon as possible.
Could you please post the output of show --usage in this PR?

I have to put you on the wait list, like all other currently open PRs. The reason is I am in the middle of re-writting the mount-subsystem from scratch (#2449 is the main PR collecting each of the several modifications). Currently I am working on SSH profiles (#2462), after that I need to implement encrypted SSH profiles and finally I have to do some clean up. Nearly every file in the repo is affected, so be prepared for merge conflicts. The codebase is not in the shape doing this in clean isolated steps.

I don't like to slow down a contributor, but I think it is the cleanest way. It still will take several weeks. Watch #2449 for progress in this matter.

Please see the projects background information to get an idea about our workflow and priorities:

Regards,
Christian

@buhtz buhtz added the PR: Waiting for review PR won't be merged until review and approval from a member of the maintenance team. label May 11, 2026
@buhtz buhtz added this to the Upcoming next (2.0.0) milestone May 11, 2026
@arcsinhx
Copy link
Copy Markdown
Author

arcsinhx commented May 11, 2026

Here are the two --usage output cases. The first one shows that --usage calculates the total disk usage. And in the last snapshot, I removed a large folder. So we can see --usage with --last only shows the last snapshot's disk usage.

./backintime show --usage --profile 1
Total disk usage: 3.0 GiB
20260510-000520-214
20260510-165800-738
20260511-105140-494
./backintime show --usage --profile 1 --last
Total disk usage: 4.0 MiB
20260511-105140-494

@buhtz
Copy link
Copy Markdown
Member

buhtz commented May 11, 2026

Very nice. If I am right, with this we could also calculate the storage savings?

Calculate the usage of each single backup, summarize them and relate that to the total usage number.
Here a quick n dirty example assuming that each backup is 5 GB (15GB is 100%).

Total disk usage: 3.0 GiB (saving 80% of disc usage because of hardlinks)
20260510-000520-214
20260510-165800-738
20260511-105140-494

@arcsinhx
Copy link
Copy Markdown
Author

Yes, we can use du for each snapshot directory independently and simply sum the results to calculate the disk usage that if we expand all hard link to real size files. Then, the saving rate can be calculated.
As for your case, if we only add a 5GB file in the first snapshot and create two snapshots without any file changes. Current method will get 5GB result while the "simply sum" method will get 15GB results. So the saving rate is (15-5)/15=66.7%

@buhtz
Copy link
Copy Markdown
Member

buhtz commented May 25, 2026

The new mount subsystem is read for testing incl. full gocryptfs support as encfs replacement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Waiting for review PR won't be merged until review and approval from a member of the maintenance team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants