Bug 258460 - New port: sysutils/zsd-cli Find older versions of a given file in your zfs snapshots.
Summary: New port: sysutils/zsd-cli Find older versions of a given file in your zfs sn...
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-12 14:51 UTC by Ben Lavery-Griffiths
Modified: 2023-01-18 09:37 UTC (History)
2 users (show)

See Also:


Attachments
git diff for new port (2.49 KB, patch)
2021-09-12 15:20 UTC, Ben Lavery-Griffiths
ben: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Lavery-Griffiths 2021-09-12 14:51:27 UTC
This is a CLI based variant of sysutils/zfs-snap-diff

I've called it zsd-cli due to there already being another port called sysutils/zsd which refers to a different tool.

- portlint: OK (looks fine.)

- testport: OK (poudriere: <11.4-RELEASE, 11.4-STABLE, 12.2-RELEASE, 12.2-STABLE, 13.0-RELEASE, 13.0-STABLE, 14.0-CURRENT>, < amd64/i386 >, <manpages + with/without extended> tested)
Comment 1 Ben Lavery-Griffiths 2021-09-12 15:20:49 UTC
Created attachment 227858 [details]
git diff for new port
Comment 2 Joseph Mingrone freebsd_committer freebsd_triage 2021-09-20 19:35:03 UTC
Hello Ben,

Looks good.

I made a few minor modifications:

- Add missing directory to sysutils/Makefile
- Minor reordering to satisfy portclippy/portfmt
- Minor wording change to shorten comment
- Minor changes to pkg-descr and update WWW to use the site pointed to by the author

There seems to be a problem with my run-time tests, or I don't understand how it's supposed to work.  For a certain file, ~/scm/ports-scripts.git/stage, I see lots of snapshots and I can do diffs showing there have been changes.  Also, zfs-snap-diff says "11 file versions between 18 September 2021 and 20 September 2021 found".

However, zsd reports
jrm@phe ~ % zsd -d 10 /home/jrm/scm/ports-scripts.git/stage list
scan the last 10 days for other file versions
  # | File changed | Snapshot | Snapshot age
--------------------------------------------

Am I missing something?

Thanks,

Joe
Comment 3 Ben Lavery-Griffiths 2021-09-23 21:05:29 UTC
(In reply to Joseph Mingrone from comment #2)

Hi Joe, 

Please accept my apologies for the slow reply - it's been a busy week!

I'm not seeing the same on my system.  Unfortunately I don't have a system with many recent snapshots here, but I do have some fairly old snapshots:

root@zotac-bsd:~ # zfs list -t snap | wc -l
     492
root@zotac-bsd:~ # zfs list -t snap zroot/backup/manaha/zroot/iocage/jails/mysql/root | wc -l
      40
root@zotac-bsd:~ # /tmp/zsd -d 430 -H /backup/manaha/zroot/iocage/jails/mysql/root/backup/gitea.sql list | wc -l
      35

zfs-snap-diff reports:
> 36 file versions between 01 February 2020 and 23 September 2021 found.
That'll be 25 files + live version

root@zotac-bsd:~ # freebsd-version -ku
13.0-RELEASE-p4
13.0-RELEASE-p4

Can you reproduce the problem for other files?   Or is it just this one?
Comment 4 Joseph Mingrone freebsd_committer freebsd_triage 2022-02-19 16:05:36 UTC
Hello Ben,

My turn to apologize for the slow reply.  Sorry, I lost track of this bug.  I'm crunched for time at the moment, so going to add it back to the pool, so another developer can pick it up.
Comment 5 Ben Lavery-Griffiths 2023-01-18 09:37:55 UTC
I don't have time to maintain this - if someone else would like this in the Ports tree they could maybe pick up where I left off...