SliTaz SliTaz Forum

You are not logged in.

#1 2016-04-08 12:56:29

Cobra
Member
Registered: 2016-04-07
Posts: 4

Time issue at boot

Hello,

I got a little problem i can't fix after many trials.

My script is launched at boot and has to write date and time into a file, this is working excepted that it print a different hour than the real. I tried to manage this with date, date -u, hwclock ...

Indeed at the boot of my device, I manually write date command and in 10-15sec it changes from 12:00 to 14:00 for instance, like if something is loaded after boot.

My /etc/TZ value is Europe/Paris, i also try with another value(UTC, UTC+1...) but the time is still changing many seconds after boot.

This is embarassing because my script write a false hour in my log file at boot and then it writes the real hour.

Do i have to change something between date and hwclock or is that something wrong with my configuration ?

Thanks

Offline

#2 2016-04-08 14:01:41

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: Time issue at boot

In your script, insert the following line:

export TZ=$(cat /etc/TZ)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 10 queries executed - Memory usage: 1.53 MiB (Peak: 1.77 MiB) ]