Local time for backup timestamp

I’m running MineOS on Virtualbox. The virtual machine has the correct UTC. From the command line I have changed the timezone using tzselect. In the web-ui when I click “create a restore point”, the web-ui completes the restore point but reports the most recent restore point to be 10 hours ago (because it is basing it on UTC, not my local time). The calendar also shows the time of the restore point as UTC not local time.

What is the correct procedure for keeping everything in local time in the web-ui?

(I think I am running the latest web-ui, although it is hard to tell to be honest. Clicking the down arrow at the top right of screen shows “git commit: 37e4a9d”).

The timestamps pull from Linux and should reflect the date/time that the date utility returns from the command prompt.

For example, in my MineOS installation:

root@mineos ~# date
Tue Feb 14 02:42:22 UTC 2017
root@mineos ~# echo $TZ

root@mineos ~# export TZ='America/Phoenix'; date
Mon Feb 13 19:43:12 MST 2017
root@mineos ~# cat /etc/timezone 

As you can see here, the $TZ environment variable changes the timezone that date reports. However, unless $TZ is reset on each login (or reboot, etc.), it’ll fall back to /etc/timezone. Thus, you might want to edit the file for permanence to fit your timezone, and I believe this problem should be fixed.

As an aside, your commit is pretty dated: 37e4a9d is from August, and there have been many updates since (including a lot of package dependency upgrades). Even without a specific problem you might be experiencing, it’s still a good idea to keep updated (for memory leak fixes or other assorted issues).

Here’s a link to the webui updating instructions.

Thanks Will, thanks for your comments! I have updated the webui :slight_smile:

With regards to the timezone, I entered the export TZ command that you listed (but with my timezone). Now, when I enter the “date” command Linux reports the correct time for my timezone. So far so good.

After some testing I have discovered:
(1) Restore points show the UTC time when looking at the list of restore points in MineOS
(2) Archives show the local time when looking at the list of archives in MineOS
(3) Both restore points and archives show the UTC time when looking at the calendar in MineOS.

This doesn’t seem right to me, or am I doing something wrong? I appreciate your comment about editing the timezone file to make sure the time zone setting survives a reboot, but at this stage I’m just trying to have the correct time reported before attempting a reboot.

In all likelihood, this problem probably can’t be solved without changing the timezone file. (or at least, that’s what I’m speculating right now).

Restore points are created when MineOS opens up a new process for rdiff-backup; this new process probably isn’t inheriting all the environment variables that you set (in the terminal), and therefore, even if date is showing the right date now, these other processes don’t have $TZ and are reverting back to what date provides when it is unset.

Archives are created in MineOS with a new process as well, so the timestamps are likely to be in the unset $TZ timestamp. However, it gets confusing because the names of the files themselves are pulled from nodejs which I guess is pulling from a different place.

See the thing is that Linux has two clocks, the hardware clock and the “software clock” and the HW clock is in UTC (which is good), so we just need the entire Linux to be fully aware of your timezone so all presented-to-the-user dates can be in your usable local time.

I think the answer to this is /etc/timezone. I think that even without a reboot (which may not be necessary at all), changing the timezone file should help Linux report only your local time in all places.

Thanks Will. Editing /etc/timezone did not help, however while Googling I found this link: http://unix.stackexchange.com/questions/76710/changing-timezone-on-debian-keeps-local-time-in-utc

I applied the “answer” in that link and that solved my problem. Both restore points and archives now show in my local time in MineOS.