dCore Import Debian Packages to Mountable SCE extensions > dCore x86_64

time changes

(1/1)

jls:
Hi
After some minutes the time changes.
I set it but it doesn't keep.
Thanks

Jason W:
Give the output of the the command:


--- Code: ---date

--- End code ---

both before and after the change. And the command used to set it.  Do you have any scripts that set or alter the time on startup?  I use ntpdate in a script to set my time to the internet time service on boot.  The time changes when the script is run, which can interfere with certain running programs but it normally runs before I reach the desktop.

jls:
Hello Jason,

--- Code: ---jls@box:~$ date
mar  6 ago 2019, 08.57.56, CEST
jls@box:~$

--- End code ---
I have the following command in /opt/bootlocal.sh:

--- Code: ---( sleep 20 && ntpdate -u ntp1.inrim.it && etc/init.d/ntp start) &

--- End code ---
infact when the system is started:

--- Code: ---jls@box:~$ ps|grep ntpd
ntp      10849     1  0 08:14 ?        00:00:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 101:101
jls      12607 12187  0 08:21 pts/0    00:00:00 grep ntpd
jls@box:~$

--- End code ---
Bios time is wrong but if I change it to correct time then it keep going out of time.
Thanks for any help

Jason W:
Here is the script I use to set my time, and then set the hardware bios clock.  This way the bios clock can be wrong on startup, then made right with the below commands.  After the script is run and the time is set, my system time does not change on it's own after that.


--- Code: ---#!/bin/sh

sudo ntpdate -s time.nist.gov

sudo hwclock -w



--- End code ---

jls:
Hi


--- Code: ---jls@box:~$ ps|grep ntpd
ntp      11169     1  0 06:00 ?        00:00:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 101:101
jls      16823 15536  0 06:56 pts/1    00:00:00 grep ntpd
jls@box:~$ sudo hwclock --show && date
2019-08-08 09:37:58.771268+0200
gio  8 ago 2019, 06.39.04, CEST
jls@box:~$ pgrep ntpd
11169
jls@box:~$ sudo hwclock --show && date
2019-08-08 09:43:24.195429+0200
gio  8 ago 2019, 09.43.25, CEST
jls@box:~$ sudo hwclock --show && date
2019-08-08 09:53:53.036795+0200
gio  8 ago 2019, 06.54.59, CEST
jls@box:~$


--- End code ---

Navigation

[0] Message Index

Go to full version