zfs-snap-diff

zfs-snap-diff - web application to find older file versions in zfs snapshots and zfs snapshot management tool.

With zfs-snap-diff you can

  • create, destroy, rename, rollback and clone snapshots in the webapp

  • find older file versions in your zfs-snapshots for a given file

  • view the file content of a given snapshot

  • inspect a diff from the older version to the actual version

  • revert a single change

  • restore a version from a zfs snapshot

  • download a file version

  • browse the directory content of a snapshot

  • download a zip-archive from any folder in your snapshots

  • bookmark often used folders

Usage

maināŸ© zfs-snap-diff -h
zfs-snap-diff - web application to find older file versions in zfs snapshots and zfs snapshot management tool.

USAGE:
  ./zfs-snap-diff [OPTIONS] <ZFS_DATASET_NAME>

OPTIONS:
  -V	print version and exit
  -a	listen on all interfaces
  -cert string
        TLS certificate file
  -compare-method string
        used method to determine if a file was modified ('auto', 'mtime', 'size+mtime', 'content', 'md5') (default "auto")
  -d int
        days to scan (default 7)
  -diff-context-size int
        show N lines before and after each diff (default 2)
  -key string
        TLS private key file
  -l string
        webserver listen address (default "127.0.0.1")
  -log-locations
        log messages with caller location
  -log-timestamps
        log messages with timestamps in unix format
  -mount-snapshots
        mount snapshot (only necessary if it's not mounted by zfs automatically
  -p int
        webserver port (default 12345)
  -tls
        use TLS - NOTE: -cert <CERT_FILE> -key <KEY_FILE> are mandatory
  -use-cache-dir-for-backups
        use platform depend user local cache directory for backups (default true)
  -use-sudo
        use sudo when executing 'zfs' commands
  -v	debug output
  -vv
        trace output with caller location
  -webapp-dir string
        when given, serve the webapp from the given directory

Project home page: https://j-keck.github.io/zfs-snap-diff

Startup

  • startup a server instance
./zfs-snap-diff [OPTIONS] <ZFS_DATASET_NAME>

This starts an embedded webserver and serves the included web-app at http://127.0.0.1:12345.

  • open your webbrowser at
http://127.0.0.1:12345

Browse the actual filesytem

You can browse the actual filesystem and inspect a diff from the actual file version to the older file version in the selected snapshot, revert a single change or restore a whole file.

Screenshot from 'Browse filesystem'

Browse snapshots

In this view you can view and manage all snapshots.

Screenshot from 'Browse snapshots'

and inspect the directory content where the snapshot was created

Browse snapshots / directory browser

Create snapshots

To create a snapshot of the actual dataset use the camera symbol in the dataset selector.

You can enter a snapshot name in “Snapshot name template” and zfs-snap-diff will show the resulting name in “Snapshot name”.

The template supports the following format sequences:

Format sequences are alike the `date` command
  %d: day of month (e.g., 01)
  %m: month (01..12)
  %y: last two digits of year (00..99)
  %Y: year
  %F: full date; like %Y-%m-%d
  %H: hour (00..23)
  %I: hour (01..12)
  %M: minute (00..59)
  %S: second (00..60)
  %s: seconds since 1970-01-01 00:00:00 UTC

The default snapshot name template is per snapshot-name-template configurable.

Snapshot management

If you use any snapshot management functions, remember to use the -use-sudo flag!

You can click the symbol to show the snapshots actions.

Rename snapshot

Destroy snapshot

Clone snapshot

The newly created dataset will only listed if the parent datasets mountpoint is not none or legacy.

Rollback snapshot

Download zip-archive

With the symbol in the file browser you can download a whole directory as a zip-archive. You can download a archive from the actual filesystem or from a snapshot.

The archive size is restricted by default. You can configure per max-archive-unpacked-size-mb.