Open ryanmasse opened 6 years ago
Same here on Arch Linux running:
spl-linux 0.7.3.4.13.9.1-1
spl-utils-common 0.7.3-1
zfs-auto-snapshot-git 1:1.2.1.1.r2.049e966-1
zfs-linux 0.7.3.4.13.9.1-1
zfs-utils-common 0.7.3-1
$ sudo zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
tank@znap_2017-10-31-1458_hourly 256K - 439G -
tank@znap_2017-10-31-1502_hourly 96K - 445G -
tank/test@znap_2017-10-31-1502_hourly 0B - 96K -
$ date
Tue Oct 31 11:03:59 EDT 2017
Here's the culprit:
To get it in your locale, just remove the --utc
part. I feel like UTC should be an option for the timestamp, instead of the default?
I think it makes sense as the default. UTC is unambiguous and monotonic. Due to DST, snapshot names in local time do not always order chronologically if sorted lexographically. And if you are unlucky, snapshotting can fail due to a duplicated name.
If UTC is already the default (which I didn’t verify), then changing it means breaking backwards compatibility.
I agree with rlaager - UTC makes things unambiguous (ok, it won't help if you mess up server/computer time)
what if it were configurable? :)
@slopokeit Yeah, that's kinda where I was heading. @rlaager makes a good point to keep UTC the default, but it would be handy to have it configurable rather than having to edit the script.
The default was local TZ until: https://github.com/zfsonlinux/zfs-auto-snapshot/pull/18
Strangely the comment thread mentions that a program option should be added to preserve backwards compatibility but the pull was merged without it.
I have created https://github.com/zfsonlinux/zfs-auto-snapshot/pull/77 which leaves the default as UTC but adds a program option --local-tz
to allow using the local system's timezone.
I made something similar but also added the timezone abbreviation to address the problem with DST: #105
In fact, the UTC time seems to be the way to go. I have checked with the following configuration in the /etc/samba/smb.conf
(not in the registry!)
vfs objects = shadowcopy2 shadow: snapdir = .zfs/snapshot shadow: sort = desc shadow: format = -%Y-%m-%d-%H%M shadow: snapprefix = ^zfs-auto-snap(frequent){0,1}(hourly){0,1}(daily){0,1}(monthly){0,1} shadow: delimiter = -20
I see the name zfs-auto-snap_frequent-2023-11-06-2145
of the snapshot on the ZFS volume in Linux, but windows 10 client converts it into the local time under "Previous versions".
I use "Samba version 4.17.12-Debian".
I'm assuming it's recording the date as UTC? Is there any way of switching it to reflect the local time?
storage/mysqllogs@zfs-auto-snap_frequent-2017-10-20-1600 0 - 40.7K - root@db1:~# date Fri Oct 20 12:14:47 EDT 2017