httm prints the size, date and corresponding locations of available unique versions of files residing on ZFS snapshots

Overview

asciicast

Don't call it a h-- t-- time machine

httm prints the size, date and corresponding locations of available unique versions (dedup-ed by modify time and size) of files residing on ZFS snapshots, as well as the interactive viewing and restoration of such files.

Inspired by the wonderful findoid but about twice as fast in the ordinary case. Ready and able to be used in scripted interactive shell apps and widgets.

httm also boasts an array of seductive features, like:

  • Search for deleted files! Ooooooooo!
  • Select non-immediate datasets (on a different pool, or remote).
  • For use with even rsync-ed non-ZFS local datasets (like ext4, APFS, or NTFS), not just ZFS.
  • Fully native, interactive restore (no shell scripts needed, but you do you!)
  • Select from several formatting styles.
  • Parseable ... or not ... oh my!

Use in combination with you favorite shell and a fuzzy finder like sk or fzf for even more fun.

Installation

The httm project contains two components:

  1. The httm executable: To install git clone this repo, and cargo build for right now. On MacOS, you will have to code-sign to use the remote capabilities. Sorry kids!
  2. The several outdated example scripts: To install just place somewhere in your PATH. ~~ Depends upon sk or skim because that's my jam.~~ UPDATE: httm no longer depends on skim, as it now calls skim as a library, in full interactive mode.

Look ma no hands -- no shell scripts needed for ZFS restore!

License

httm is licensed under the MPL 2.0 License - see the LICENSE file for more details.

Comments
  • Snapshots not detected with btrfs

    Snapshots not detected with btrfs

    Problem: Existing snapshots are not being detected when commands like doas httm -i ~/ are used when snapshots are under /mnt/rpool/snapshots/home, where /mnt/rpool is the root.

    Steps to reproduce:

    1. Have the root mounted under a directory, such as /mnt/rpool with something like this in /etc/fstab (may have to restart computer instead of just using doas mount -a after adding to /etc/fstab)
    UUID=...	/mnt/rpool	btrfs     	...,subvolid=5,subvol=/	0 0
    
    1. Create a directory to hold the snapshots, i.e. doas mkdir -p /mnt/rpool/snapshots/home
    2. Create a snapshot of the home subvolume (assuming /home is a subvolume), doas btrfs subvolume snapshot -r /home /mnt/rpool/snapshots/home/@home.test
    3. Run doas httm -i ~/

    Expected results: Snapshot under /mnt/rpool/snapshots/home/@home.test appears as an option.

    Actual results: Snapshot doesn't appear as an option.

    Additional information: The (trimmed down) results of doas btrfs subvolume list -s / are:

    ID 3005 gen 594605 cgen 198847 top level 5 otime 2021-10-31 12:19:14 path @
    ID 7309 gen 591271 cgen 466749 top level 5 otime 2022-04-03 05:50:56 path snapshots/home/@home.20220403T0550
    ID 8040 gen 591271 cgen 521624 top level 5 otime 2022-05-01 00:00:01 path snapshots/home/@home.20220501T0000
    ID 8041 gen 591271 cgen 521690 top level 5 otime 2022-05-01 00:32:41 path snapshots/root/@.20220501T0032
    ID 8208 gen 594637 cgen 535944 top level 259 otime 2022-05-08 19:54:17 path @home/kody/.local/share/Steam
    ...
    ID 9017 gen 592987 cgen 592986 top level 5 otime 2022-06-07 21:40:26 path snapshots/root/@.20220607T2140
    ID 9018 gen 592988 cgen 592987 top level 5 otime 2022-06-07 21:40:26 path snapshots/root/@.20220607T2140_1
    ...
    ID 9038 gen 594602 cgen 594602 top level 5 otime 2022-06-08 20:00:01 path snapshots/home/@home.20220608T2000
    
    opened by KodyVB 14
  • httm -d -R ~ High CPU Usage

    httm -d -R ~ High CPU Usage

    Ubuntu 22.04 - AMD Ryzen 9 5950X 32GB RAM

    When running "httm -d -R ~" CPU spikes and PC becomes unresponsive.

    installed from httm_0.17.0_amd64.deb

    opened by vudutech 9
  • `--preview` does not work

    `--preview` does not work

    Love this utility, it's really neat! Unfortunately --preview doesn't seem to work? I just built 0.17.4 using a custom fork of nixpkgs, and running httm --preview -s looks like this:

    image

    Then after selecting a file that changed, this is the next screen:

    image

    As you can see, there's no diff shown. Could this be because of custom FZF settings? Other settings don't seem to influence the appearance of httm (I have a custom cursor for example), but maybe that's a potential source of bugs. I tried just --preview as well as custom commands (--preview='delta {snap_file} {live_file}' and --preview='diff {snap_file} {live_file}'), none seemed to work. Any idea why not?

    PS: Maybe if no arguments are specified in --preview, assume that the command just takes arguments in diff order?

    bug good first issue wontfix 
    opened by heyarne 6
  • Release 0.13.0 does not compile

    Release 0.13.0 does not compile

    When attempting to build from source:

       Compiling httm v0.13.0 (/home/me/httm)
    error[E0716]: temporary value dropped while borrowed
       --> src/utility.rs:286:26
        |
    286 |     let mut out_locked = std::io::stdout().lock();
        |                          ^^^^^^^^^^^^^^^^^       - temporary value is freed at the end of this statement
        |                          |
        |                          creates a temporary which is freed while still in use
    287 |     write!(out_locked, "{}", output_buf)?;
        |     ------------------------------------ borrow later used here
        |
        = note: consider using a `let` binding to create a longer lived value
    
    For more information about this error, try `rustc --explain E0716`.
    error: could not compile `httm` due to previous error
    cargo-deb: build failed
    
    opened by jimsalterjrs 6
  • Error: httm could not find any valid ZFS datasets on the system. (FreeBSD)

    Error: httm could not find any valid ZFS datasets on the system. (FreeBSD)

    Hi there, I just set up a clean bare metal machine with ZFS to try HTTM. Here was my install process:

    zfs snapshot -r bootdev5@orig
    pkg install git rust
    export PATH=$PATH:/root/.cargo/bin
    git clone https://github.com/kimono-koans/httm.git
    cargo install --path ./httm/
    [no errors]
    zfs snapshot -r bootdev5@after-httm
    

    And then I go: httm -I -R ~/ And it goes: Error: httm could not find any valid ZFS datasets on the system.

    Did I miss a step?

    bug 
    opened by bellhyve 5
  • httm isn't portable across linux

    httm isn't portable across linux

    The issue: ./httm: /lib/x86_64-linux-gnu/libm.so.6: version 'GLIBC_2.29' not found (required by ./httm)

    Happens of officially supported debian/buster.

    Is there any choice to compile it against musl instead of glibc or at least lower requirement to have only most recent version ? It would be also pretty useful if utility would be truly statically compiled to avoid any dependencies that allows to use it across all Linuxes regardless of distribution and versions

    opened by CompuRoot 4
  • .deb packages provided cannot install on Ubuntu 20.04

    .deb packages provided cannot install on Ubuntu 20.04

    I tried using the provided .deb packages on an Ubuntu 20.04 server; neither the 0.13.0 nor 0.12.11 packages could be installed due to version conflict with libc.

    dpkg: dependency problems prevent configuration of httm:
     httm depends on libc6 (>= 2.34); however:
      Version of libc6:amd64 on system is 2.31-0ubuntu9.9.
    

    When built directly from the packaged source, 0.12.11 worked fine; the method I used was downloading the source from the 0.12.11 release, apt install cargo, then cargo deb followed by dpkg -i on the freshly built local package.

    opened by jimsalterjrs 3
  • Proposal: A btrfs port of httm

    Proposal: A btrfs port of httm

    Reposted from r/btrfs:

    ...

    When last I asked, I, perhaps too hastily, decided a port wasn't for me, because httm couldn't be made to easily work for all auto-snapshot programs (because the snapshot subvolumes/directories were never in the same place).

    Now, I think searching for the most common subvolume mount points (.snapshot for Snapper, etc.) and/or letting the user set another directory via an environment variable (e.g., BTRFS_RELATIVE_SNAPSHOT_DIR) would be enough to cover most use btrfs use cases.

    I'd like to ask:

    1. Is this a sane approach?
    2. Should (when do) I ever need to care about "@" subvolumes? That is -- if my PWD is /var/log, and I have a snapshot subvolume for /var/log, the location of .snapshots will generally always be at /var/log/.snapshots/?
    3. What are the most common snapshot-ing schemes used by btrfs users besides snapper (.snapshots) and timeshift (timeshift-btrfs/snapshots)?
    4. Is there anyone here, who keeps lots of snapshots (100s-1000s), who would be willing to test the software on their system?
    5. Could some snapper/timeshift users post their detailed mount and btrfs-subvolume(8) information so that I'm sure what I'm doing comports with how btrfs is used in practice? Perhaps to a Github issue I open? I'd particularly be interested in anyone who backs up (send/receive) their root volumes locally to another volume/pool.
    6. When you wish to view your snapshots read-only, are subvolumes automounted as needed or must you use some other process to mount?
    enhancement 
    opened by kimono-koans 3
  • Simplify install steps and optimize release builds

    Simplify install steps and optimize release builds

    A few simple changes:

    • Combine the git clone and build steps into a single command
    • Enable linker optimizations (https://doc.rust-lang.org/cargo/reference/profiles.html#lto)
    • Automatically strip the release binary (reduces the size of the release binary)
    opened by veloxl 3
  • usability: document how to take snapshots manually or on an interval

    usability: document how to take snapshots manually or on an interval

    My system is using zsys to do snapshots, which seem to happen when I install things with apt.

    httm should provide some generalized documentation on how to create snapshots either manually or scheduled, so that there are more snapshots to choose from when using httm. Especially given the low disk cost of snapshots in zfs.

    documentation 
    opened by bketelsen 3
  • Search for deleted files does not work

    Search for deleted files does not work

    I ran httm -i on a ZFS dataset and searched for a deleted file. It could not find it. I also tried select mode with httm -s and it doesn't show the file. Findoid finds it in the snapshot. I installed using cargo and am running version 0.5.2

    enhancement 
    opened by CKingX 3
Releases(0.18.3)
Owner
null
Display ZFS datasets' I/O in real time

ztop Display ZFS datasets' I/O in real time Overview ztop is like top, but for ZFS datasets. It displays the real-time activity for datasets. The buil

Alan Somers 40 Nov 23, 2022
A Yocto setup and management tool that helps you keep your environment up-to-date and in-sync with your team

yb (Yocto Buddy) yb is designed to make it easy to setup and (perhaps more importantly) keep Yocto environments up-to-date and in-sync with your team.

null 13 Oct 31, 2022
Get your loadshedding schedule in your calendar and never be left in the dark! Open-source, up-to-date, and developer friendly.

Loadshedding schedules in your digital calendar. No apps, no ads, up-to-date, and developer friendly. Get it • Key Features • Using the data • Project

Boyd Kane 117 Apr 26, 2023
Game of life rendered in your terminal with over 500+ unique patterns to choose from.

Controls a: play animation n: next generation s: stop j or down arrow: go down next pattern (note: you have to stop the animation to browse the patter

Omar Magdy 20 Dec 22, 2022
🗄️ A simple (and safe!) to consume history of Client and Studio deployment versions.

??️ Roblox Version Archive A simple (and safe!) to consume history of Client and Studio deployment versions. About Parsing Roblox's DeployHistory form

Brooke Rhodes 4 Dec 28, 2022
Web-based tool that allows browsing and comparing symbol and type information of Microsoft Windows binaries across different versions of the OS.

WinDiff About WinDiff is an open-source web-based tool that allows browsing and comparing symbol and type information of Microsoft Windows binaries ac

Erwan Grelet 208 Jun 15, 2023
Easy, Simple, Clean. Making status bars reliable and up-to-date.

Simple Status Easy, Simple, Clean. Making status bars reliable and up-to-date. Installation Compiling simple_status yourself doesn't require much. Ins

James Butcher 5 Aug 1, 2022
Get up-to-date departure times for Munich public transport in your terminal.

MVG Fahrinfo MVG Fahrinfo is a CLI tool to keep up-to-date with latest departure times of Munich public transport. The app is a native binary and uses

Faisal Bin Ahmed 70 Nov 14, 2023
Nvm - Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

Node Version Manager Table of Contents Intro About Installing and Updating Install & Update Script Additional Notes Troubleshooting on Linux Troublesh

nvm.sh 63.8k Jan 7, 2023
A command line tool for easily generating multiple versions of a configuration file from a single template

MultiConf A command line tool for easily generating multiple versions of a configuration file from a single template. Why? I'm a big fan of the i3 win

Ian Clarke 4 Dec 10, 2022
Costless typed identifiers backed by UUID, with kind readable in serialized versions

Why kind ? With kind, you use typed identifiers in Rust, with no overhead over Uuid have the type be human readable and obvious in JSON and any export

Wingback 67 Mar 24, 2024
Extract core logic from qdrant and make it available as a library.

Qdrant lib Why? Qdrant is a vector search engine known for its speed, scalability, and user-friendliness. While it excels in its domain, it currently

Tyr Chen 27 Jan 1, 2024
A small Rust library that let's you get position and size of the active window on Windows and MacOS

active-win-pos-rs A small Rust library that let's you get position and size of the active window on Windows and MacOS Build % git clone https://github

Dmitry Malkov 21 Jan 6, 2023
Tricking shells into interactive mode when local PTY's are not available

Remote Pseudoterminals Remote Pseudoterminals or "RPTY" is a Rust library which intercepts calls to the Linux kernel's TTY/PTY-related libc functions

null 135 Dec 4, 2022
Split text into semantic chunks, up to a desired chunk size. Supports calculating length by characters and tokens

Large language models (LLMs) can be used for many tasks, but often have a limited context size that can be smaller than documents you might want to use. To use documents of larger length, you often have to split your text into chunks to fit within this context size.

Ben Brandt 4 May 8, 2023
Not the fastest terminal colors library. Don't even ask about size.

TROLOLORS Not the fastest terminal colors library. Don't even ask about size. Why? Don't even try to use it. But maybe you need to say to your boss th

Dmitriy Kovalenko 15 Oct 27, 2021
Rust derive-based argument parsing optimized for code size

Argh Argh is an opinionated Derive-based argument parser optimized for code size Derive-based argument parsing optimized for code size and conformance

Google 1.3k Dec 28, 2022
Tight Model format is a lossy 3D model format focused on reducing file size as much as posible without decreasing visual quality of the viewed model or read speeds.

What is Tight Model Format The main goal of the tmf project is to provide a way to save 3D game assets compressed in such a way, that there are no not

null 59 Mar 6, 2023
Rusty Shellcode Reflective DLL Injection (sRDI) - A small reflective loader in Rust 4KB in size for generating position-independent code (PIC) in Rust.

Shellcode Reflective DLL Injection (sRDI) Shellcode reflective DLL injection (sRDI) is a process injection technique that allows us to convert a given

null 242 Jul 5, 2023