Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ideal output format for integration with snapshot-timemachine #12

Closed
kryptt opened this issue Jun 17, 2020 · 5 comments
Closed

ideal output format for integration with snapshot-timemachine #12

kryptt opened this issue Jun 17, 2020 · 5 comments

Comments

@kryptt
Copy link

kryptt commented Jun 17, 2020

Hi, I am currently working on a pull request (mrBliss/snapshot-timemachine#4) to integrate this tool directly within emacs.

I'm currently using the verbose debug output (-v) to capture the dataset mount path.

An optimal listing would be in to form:

idx | snapshot name | snapshot file | file date

so if currently running zsd -d 15 .spacemacs list outputs

# Snapshot Snapshot age
0 autosnap_2020-06-11_23:59:00_daily 5 days
1 autosnap_2020-06-04_23:59:05_daily 12 days

I would benefit from running zfs -d 15 --timemachine .spacemacs list to output

# Snapshot Snapshot file File Date
0 autosnap_2020-06-11_23:59:00_daily /home/rhansen/.zfs/snapshot/autosnap_2020-06-11_23:59:00_daily/.spacemacs Jun 5 23:14
1 autosnap_2020-06-04_23:59:05_daily /home/rhansen/.zfs/snapshot/autosnap_2020-06-04_23:59:05_daily/.spacemacs Jun 12 15:15

An additional option to omit the headers would be a nice extra.

What do you think?

@j-keck
Copy link
Owner

j-keck commented Jun 17, 2020

Hey,

if it's ok for you, i would use the -snapshot-timemachine flag for this.

Did you need a header, or always remove it?

would this output format ok for you?

..priv/zfs-snap-diff⟩ ./zsd -snapshot-timemachine  cmd/zsd/main.go  list
0	zfs-auto-snap_hourly-2020-06-17-13h00U	/home/.zfs/snapshot/zfs-auto-snap_hourly-2020-06-17-13h00U/j/prj/priv/zfs-snap-diff/cmd/zsd/main.go	Jun 17 15:00
1	zfs-auto-snap_frequent-2020-06-17-12h45U	/home/.zfs/snapshot/zfs-auto-snap_frequent-2020-06-17-12h45U/j/prj/priv/zfs-snap-diff/cmd/zsd/main.go	Jun 17 14:45

With the -snapshot-timemachine flag, the output would be:

  • without header
  • fields separated with a single tab
  • filepath in the snapshot included
  • absolute date (MMM D HH:MI)

i have implemented a prototype in 39822c4

@kryptt
Copy link
Author

kryptt commented Jun 17, 2020

yup, that works perfectly fine!

@j-keck j-keck closed this as completed in 6a79075 Jun 17, 2020
@j-keck
Copy link
Owner

j-keck commented Jun 17, 2020

The build currently fails, so the artifacts are not build: https://github.com/j-keck/zfs-snap-diff/runs/780753110

I'm on it.

@j-keck j-keck reopened this Jun 17, 2020
@j-keck
Copy link
Owner

j-keck commented Jun 17, 2020

build fixed and the new version with the changes are released:
https://github.com/j-keck/zfs-snap-diff/releases/tag/v1.1.1

@j-keck j-keck closed this as completed Jun 17, 2020
@priyadarshan
Copy link

This is fantastic, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants