Open bdrewery opened 7 years ago
This is really an edge case, and I just saw that there is already an option to use UTC for the timestamps:
-u Use UTC for snapshots.
So I'm not sure whether it is needed to create a workaround for this. It will happen only once a year :)
You suggested adding the TZ in on IRC, I like that.
Well, specifically the time zone offset, not the time zone itself. Or would zfs-auto-snap_frequent-2017-10-29-02h45-CEST
and zfs-auto-snap_frequent-2017-10-29-02h45-CET
be clear enough?
I think I'd like zfs-auto-snap_frequent-2017-10-29-02h45+0200
and zfs-auto-snap_frequent-2017-10-29-02h45+0100
better, but 1) it's a lot of extra characters and 2) I don't know whether plus signs are a problem in snapshot names?
I suggest the server should be on UTC to avoid this issue.
I suggest the server should be on UTC to avoid this issue.
That is effectively the same as using TZ in the cronjob, or -u for the invocation.
What I'm suggesting is to make the names of the snapshots unambiguously usable even when the timezone is not UTC. For backwards compatibility, the existing names can be considered to be in UTC, while ones with added timezone suffixes are the "new" format.
Actually, I see that UTC based snapshots will already have an "U" suffix. So that at least takes care of that. Now as a user, my only question would be: "what happens if I switch to using -u after I have been taking snapshots for a long time without it?"
Also, I would suggest that the FreeBSD port at least changes its instructions to use -u, or even better, make -u the default, and provide an option to revert to the old behavior.
So the crontab part in README.md should become:
#### Crontab
15,30,45 * * * * root /usr/local/bin/zfs-auto-snapshot -u frequent 4
0 * * * * root /usr/local/bin/zfs-auto-snapshot -u hourly 24
7 0 * * * root /usr/local/bin/zfs-auto-snapshot -u daily 7
14 0 * * 7 root /usr/local/bin/zfs-auto-snapshot -u weekly 4
28 0 1 * * root /usr/local/bin/zfs-auto-snapshot -u monthly 12
Now as a user, my only question would be: "what happens if I switch to using -u after I have been taking snapshots for a long time without it?"
I just did this. The new snaps have a U
suffix and the old ones get rolled out over time as usual.
From @DimitryAndric