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

Change date format #68

Closed
psy0rz opened this issue Feb 7, 2021 · 7 comments
Closed

Change date format #68

psy0rz opened this issue Feb 7, 2021 · 7 comments

Comments

@psy0rz
Copy link
Owner

psy0rz commented Feb 7, 2021

The current date/time format is pretty unreadable.

Change it to:

pool/dataset@snapname_2021-02-10_12:49.00

@mariusvw
Copy link
Collaborator

mariusvw commented Feb 7, 2021

Personally I don't have issues with using a simple unix timestamp.
Maybe use a more precise time so you can make multiple backups in the same second without overlap.

zfs list -t snapshot -o name,creation

When dumping a backup to a file and use it on other filesystems I don't think it is handy to have colons in the filename.
For example, macOS rewrites these to slashes.

@psy0rz
Copy link
Owner Author

psy0rz commented Feb 7, 2021

Well its not set in stone. I dont want to use characters that need escaping or change to slashes. :)

And offcourse it will stay backwards compatible with the old existing snapshots.

If everybody just loves the current format, I wont change it. :)

@tpyro
Copy link

tpyro commented Apr 17, 2021

If you are going to change the format, I would recommend looking at ISO 8601 where the letter 'T' is specified as the separator. ZnapZend uses 2021-01-12T14:00:00, but 20210112T140000 is also allowed if you don't want colons.

@psy0rz
Copy link
Owner Author

psy0rz commented Apr 17, 2021

I like ZnapZend's format. Is it still iso 8601 compatible?

@tpyro
Copy link

tpyro commented Apr 17, 2021

Yes. I believe both examples above are compatible. It doesn't help with mariusvw's concerns above. Does the programming even depend on the snapshot name? Perhaps it could be "%Y-%m-%dT%H:%M:%S" by default but customizable?

Personally, coming from ZnapZend myself, I'm a bit thrown by having the backup job name as part of the snapshot. But it seems the programming might require that.

@psy0rz
Copy link
Owner Author

psy0rz commented Apr 18, 2021

@tpyro the backup name in the snapshot has two reasons:

  • Make it clearer for the admin where a snapshot belongs to.
  • Make it possible to replicate data to multiple locations. This way the snapshots on the source do not conflict with each-other.

@psy0rz
Copy link
Owner Author

psy0rz commented Oct 3, 2021

I just added the --snapshot-format option to fix #87 . So that essentially fixes this as well. The default format stayed the same offcourse to keep it compatible.

@psy0rz psy0rz closed this as completed Oct 3, 2021
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