Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »


This page is for changing the NTP time back in time (wink)   ( -3 months )


1- Check the date/time

[root@server1 ~]# date
Thu 11 Aug 07:26:08 BST 2016
or

[root@server1 ~]# timedatectl
Local time: Thu 2016-08-11 07:29:11 BST
Universal time: Thu 2016-08-11 06:29:11 UTC
RTC time: Thu 2016-08-11 06:30:23
Time zone: Europe/London (BST, +0100)
NTP enabled: no
NTP synchronized: yes
RTC in local TZ: no
DST active: yes
Last DST change: DST began at
Sun 2016-03-27 00:59:59 GMT
Sun 2016-03-27 02:00:00 BST
Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2016-10-30 01:59:59 BST
Sun 2016-10-30 01:00:00 GMT



[root@server1 ~]# systemctl status ntpd.service
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2016-06-01 09:16:54 BST; 2 months 10 days ago
Process: 4501 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 4502 (ntpd)
CGroup: /system.slice/ntpd.service
└─4502 /usr/sbin/ntpd -u ntp:ntp -g
Jun 01 09:16:54 server1.hp8300 ntpd[4502]: Listen normally on 3 eth0 192.168.0.10 UDP 123
Jun 01 09:16:54 server1.hp8300 ntpd[4502]: Listen normally on 4 lo ::1 UDP 123
Jun 01 09:16:54 server1.hp8300 ntpd[4502]: Listen normally on 5 eth0 fe80::5054:ff:fe17:f9c7 UDP 123
Jun 01 09:16:54 server1.hp8300 ntpd[4502]: Listening on routing socket on fd #22 for interface updates
Jun 01 09:16:54 server1.hp8300 ntpd[4502]: 0.0.0.0 c016 06 restart
Jun 01 09:16:54 server1.hp8300 ntpd[4502]: 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
Jun 01 09:16:54 server1.hp8300 ntpd[4502]: 0.0.0.0 c011 01 freq_not_set
Jun 01 09:16:55 server1.hp8300 ntpd[4502]: 0.0.0.0 c514 04 freq_mode
Jun 01 09:32:55 server1.hp8300 ntpd[4502]: 0.0.0.0 0512 02 freq_set kernel 0.000 PPM
Jun 01 09:32:55 server1.hp8300 ntpd[4502]: 0.0.0.0 0515 05 clock_sync


2- stop the service

[root@server1 ~]# systemctl stop ntpd.service


3- change the date ( manually)

[root@server1 ~]# timedatectl set-time '2016-06-01 18:44:30'

[root@server1 ~]# date
Wed 1 Jun 18:44:32 BST 2016

[root@server1 ~]# timedatectl
Local time: Wed 2016-06-01 18:44:36 BST
Universal time: Wed 2016-06-01 17:44:36 UTC
RTC time: Wed 2016-06-01 17:44:37
Time zone: Europe/London (BST, +0100)
NTP enabled: no
NTP synchronized: no
RTC in local TZ: no
DST active: yes
Last DST change: DST began at
Sun 2016-03-27 00:59:59 GMT
Sun 2016-03-27 02:00:00 BST
Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2016-10-30 01:59:59 BST
Sun 2016-10-30 01:00:00 GMT

4- start the service

[root@server1 ~]# systemctl start ntpd.service

5a- On the client: stop, resync, start and check the date/time again


[root@centos7 ~]# systemctl stop ntpd.service

[root@centos7 ~]# ntpdate server1
1 Jun 18:51:38 ntpdate[30720]: step time server 192.168.0.10 offset -6093937.698513 sec

[root@centos7 ~]# ntpdate server1
1 Jun 18:51:46 ntpdate[30721]: adjust time server 192.168.0.10 offset 0.000031 sec

[root@centos7 ~]# systemctl start ntpd.service

[root@centos7 ~]# ntpstat
synchronised to NTP server (192.168.0.10) at stratum 7
time correct to within 1012 ms
polling server every 64 s

[root@centos7 ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*server1.hp8300 LOCAL(0) 6 u 8 64 1 0.310 -0.002 0.006

[root@centos7 ~]# date
Wed 1 Jun 18:52:15 BST 2016

[root@centos7 ~]# timedatectl
Local time: Wed 2016-06-01 18:52:30 BST
Universal time: Wed 2016-06-01 17:52:30 UTC
RTC time: Mon 2017-04-10 17:53:01
Time zone: Europe/London (BST, +0100)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: yes
Last DST change: DST began at
Sun 2016-03-27 00:59:59 GMT
Sun 2016-03-27 02:00:00 BST
Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2016-10-30 01:59:59 BST
Sun 2016-10-30 01:00:00 GMT





  • No labels