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

date in snapshot #74

Open
ryanmasse opened this issue Oct 20, 2017 · 12 comments
Open

date in snapshot #74

ryanmasse opened this issue Oct 20, 2017 · 12 comments

Comments

@ryanmasse
Copy link

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

@dpendolino
Copy link

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

@4oo4
Copy link

4oo4 commented Dec 18, 2017

Here's the culprit:

DATE=$(date --utc +%F-%H%M)

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?

@rlaager
Copy link

rlaager commented Dec 18, 2017 via email

@sjau
Copy link

sjau commented Dec 18, 2017

I agree with rlaager - UTC makes things unambiguous (ok, it won't help if you mess up server/computer time)

@ryanmasse
Copy link
Author

what if it were configurable? :)

@4oo4
Copy link

4oo4 commented Dec 18, 2017

@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.

@jbnance
Copy link
Contributor

jbnance commented Dec 22, 2017

The default was local TZ until: #18

Strangely the comment thread mentions that a program option should be added to preserve backwards compatibility but the pull was merged without it.

@jbnance
Copy link
Contributor

jbnance commented Dec 22, 2017

I have created #77 which leaves the default as UTC but adds a program option --local-tz to allow using the local system's timezone.

@polletfa
Copy link

I made something similar but also added the timezone abbreviation to address the problem with DST: #105

@adams13x13
Copy link

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 = shadow_copy2
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".

@CoryAlbrecht
Copy link

This problem still exists on Debian Bookworm

@colaH16
Copy link

colaH16 commented Dec 6, 2024

This problem still exists on Debian Bookworm.
there is no --local-tz options

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

10 participants