Code Monkey home page Code Monkey logo

Comments (5)

digint avatar digint commented on August 21, 2024

As you already mentioned, "list snapshots" is the closest. It actually shows the same data as the "tree" command in v0.20.0, but in a table format instead of a tree (you can see the up-to-date flag in the status column).

After having implemented all those nice tables, I kind of forgot how much more readable the "tree" output was compared to the more data-analysis-style "list subvolumes". I used to append the "tree" output in my status emails, but after some months of usage it got so big that it did no make much sense for me any more, but this is of course not necessarily true for others.

Furthermore, the "tree" command did not really print the whole tree (more specifically: it does not show the orphaned backups), that's why it got renamed to "list snapshots", making it clear for the user that he should run "list backups" to get the full story.

Actually, I don't really need the full "tree" output. I would really like to see, for each source_subvol, how many snapshot_subvol's there are for it, and the name of the most recent one (whether it is up to date or not would be useful as well).

I agree that something like this would make much sense, as many times you are not interested in the backups, but only the snapshots, in order to get a quick overview of your source systems.
The same would also make some sense for the backup side.

That said, I'm wondering how such commands should be named. e.g. btrbk tree snapshots and btrbk tree backups? Sounds a bit confusing...
Or maybe better rename current btrbk list snapshots/backups to btrbk resolve snapshots/backups, and have btrbk list snapshots just print the snapshot list, without its related backups? Any ideas?

from btrbk.

GrahamCobb avatar GrahamCobb commented on August 21, 2024

In the meantime, I have created a quick and dirty awk script to get the information I want from the "list snapshots --format=long" output. It doesn't handle spaces in filenames (a real solution would use the "raw" format output) but it meets my immediate need. Included below in case it is useful to anyone else.

/^snapshot/ {
    if ($3 != current_source_path) {
        if (current_source_path != "") print "Source path", current_source_path, "has", snapshots, "snapshots", status;
        current_source_path = $3;
        status = "";
        snapshots = 0;
    }
    snapshots++; total_snapshots++;
    if ($5 != "-") status = "and is " $5;
}
END {
    if (current_source_path != "") print "Source path", current_source_path, "has", snapshots, "snapshots", status;
    print "Total snapshots =", total_snapshots;
}

from btrbk.

GrahamCobb avatar GrahamCobb commented on August 21, 2024

Thanks for your reply (which I saw after I posted my comment above).

I may not be the best person to comment on naming as I only use the snapshot functionality for now ("list backups" displays nothing for me). However, my thought was to add a "--format=tree" (for the old tree output) and/or a "--format=summary" (for the sort of summary my awk script gives). Maybe those could work both for snapshots and for backups.

In any case, thanks for thinking about this!

from btrbk.

digint avatar digint commented on August 21, 2024

Just played around with your awk script, having this kind of statistics would be very useful! I opened a new issue #55 for this.

I leave this issue open for further discussion of the tree-style output.

from btrbk.

digint avatar digint commented on August 21, 2024

As btrbk now has statistics support, and all information can be displayed using list snapshots and list backups, the old btrbk tree gets obsolete.

from btrbk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.