When I do a restic backup from my Cygwin laptop, the date/time in the snapshot list is correct.
When I do a restic backup from my router shell (dd-wrt), the date/time shows four hours later than the actual time.
Both backups are to the same repo, over sftp: (if that matters).
Within the router, the date command returns the correct date and time.
Can you please paste the output of restic cat snapshot <id> for the two snapshots? Maybe we can see what’s going on. I suspect that something in the timezone configuration is wrong…
Oh, interesting, that’s actually a bug in restic: the snapshots command displays the time stamp as it is, without converting it to the local time zone first. The timestamps for your two snapshots have a different timezone: -04:00 (EST?) and Z (UTC).
I’ve written a small program which parses the timestamps:
2018-11-01 20:00:07.539578 -0400 -0400
2018-11-01 20:00:07
2018-11-02 01:00:07.539578 +0100 CET
2018-11-02 01:00:07
---------------
2018-11-02 01:00:00.93344552 +0000 UTC
2018-11-02 01:00:00
2018-11-02 02:00:00.93344552 +0100 CET
2018-11-02 02:00:00
The first line is the timestamp as has been parsed, the second line is the formatting restic applies for the snapshots command. You can see that it’s 8pm for the first snapshot, and 1am for the second snapshot, that’s just the verbatim values from the time stamp. It looks like as if the snapshots have been taken 5 hours apart.
The third line prints the timestamp converted to local time (Central European Time for me). When you then take the values it makes sense, both snapshots are an hour apart, as you can see in the fourth line.
I’ll fix this and make the snapshots command (and the others concerning time stamps) display the local time.
I installed the same beta on my dd-wrt ARM router, and the snapshots display is off by 4 hours for every snapshot when viewed from the router, but correct when viewed from my Windows laptop.
It sounds like, then, that the router’s time zone config is wonky – at least the snapshot times are consistent, so I think restic is doing its job correctly there. I can’t explain why date shows the correct timezone though.
It is strange. But then this is a dd-wrt router based on busybox.
Like you mentioned, the date shows correctly:
root@router:~# date
Sat Nov 3 14:13:15 EDT 2018
root@router:~# echo $TZ
EST5EDT,M3.2.0,M11.1.0
I’m not too concerned - I don’t use the router to do anything with restic, except for a backup.
It’s not a show-stopper that all reported snapshot times are 4 hours off…
I suspect the Go runtime is unable to extract the local timezone from the dd-wrt system, which may be different from what Linux systems normally do. I’d leave it at that (at least for now).