My Personal Wiki

La théorie, c'est quand on sait tout et que rien ne fonctionne.... La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi.

Outils pour utilisateurs

Outils du site


tutaux:linux:ntp

Modifier ou ajouter un serveur de temps


Contrôle

Je contrôle le temps avec la commande:

date
Sat Oct 28 9:50:38 UTC 2023

Je contrôle le Time Zone:

timedatectl list-timezones
Europe/Rome

J'affiche les serveurs NTP présent dans ma machine:

ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 0.debian.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.000
 1.debian.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.000
 2.debian.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.000
 3.debian.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.000
-ns3051461.ip-51 192.162.70.70    3 u  452 1024  377   12.715   +0.853   0.318
-45.128.41.10    192.168.78.236   2 u  536 1024  377   10.144  -51.092   5.361
-82-64-131-93.su 82.64.45.50      2 u  389 1024  377   21.741  -136.10 109.166
-router-ix5.serv 78.194.78.49     3 u  192 1024  377    8.749   -1.142   0.981
*villisika.miuku 85.199.214.98    2 u  221 1024  377    8.075   -1.662   1.130
+time.cloudflare 10.19.13.133     3 u  811 1024  377    7.457   -0.312   0.382
+blade2.rack1.se 29.88.99.4       2 u  935 1024  377   12.194   +0.150   0.271

Modification

NTP Serveur

J'ajoute des serveurs NTP:

nano /etc/ntp.conf
Ajouter les serveurs français:
# pool: <http://www.pool.ntp.org/join.html>
server 0.fr.pool.ntp.org
server 1.fr.pool.ntp.org
server 2.fr.pool.ntp.org
server 3.fr.pool.ntp.org

Time Zone

sudo timedatectl set-timezone Europe/Paris 

Ajouter le bon fuseau horaire:

Europe/Paris

Lister TimeZone

timedatectl list-timezones

Relancer Service

 systemctl restart ntp

Je contrôle le statut :

timedatectl status
Local time: Sat 2023-10-28 12:16:41 CEST
           Universal time: Sat 2023-10-28 10:16:41 UTC
                 RTC time: Sat 2023-10-28 10:16:41
                Time zone: Europe/Paris (CEST, +0200)
System clock synchronized: yes
              NTP service: n/a
          RTC in local TZ: no

Aide

timedatectl help
*timedatectl [OPTIONS...] COMMAND ...
 
Query or change system time and date settings.
 
Commands:
  status                   Show current time settings
  show                     Show properties of systemd-timedated
  set-time TIME            Set system time
  set-timezone ZONE        Set system time zone
  list-timezones           Show known time zones
  set-local-rtc BOOL       Control whether RTC is in local time
  set-ntp BOOL             Enable or disable network time synchronization
 
systemd-timesyncd Commands:
  timesync-status          Show status of systemd-timesyncd
  show-timesync            Show properties of systemd-timesyncd
 
Options:
  -h --help                Show this help message
     --version             Show package version
     --no-pager            Do not pipe output into a pager
     --no-ask-password     Do not prompt for password
  -H --host=[USER@]HOST    Operate on remote host
  -M --machine=CONTAINER   Operate on local container
     --adjust-system-clock Adjust system clock when changing local RTC mode
     --monitor             Monitor status of systemd-timesyncd
  -p --property=NAME       Show only properties by this name
  -a --all                 Show all properties, including empty ones
     --value               When showing properties, only print the value

tutaux/linux/ntp.txt · Dernière modification : (modification externe)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki