38

I am looking for an equivalent of 'ntpdate IPaddress' command in the chrony suite to force chronyd to synchronize time right now.

1
  • 1
    You should really check the documentation... chronyd -q When run in this mode, chronyd will set the system clock once and exit. It will not detach from the terminal. Apr 10, 2018 at 16:20

3 Answers 3

59

Try

sudo chronyc -a makestep

This will update your system clock quickly (might break some running applications), using the time sources defined in /etc/chronyd.conf.

-a is needed to avoid

501 Not authorised error

6
  • 2
    I am getting 501 Not authorised error returned and clock stays the same
    – Dimitry K
    Jul 5, 2018 at 9:58
  • Are really you running as root (sudo)? You are talking to chronyd, because it sends you away with a rejection. This is covered in the chrony FAQ Jul 6, 2018 at 22:31
  • Yepp, running as root. Just double checked.
    – Dimitry K
    Jul 7, 2018 at 16:47
  • 8
    Try to run with the -a parameter (authenticate automatically) sudo chronyc -a makestep Dec 19, 2018 at 16:21
  • 3
    The man page for chronyc (chrony) version 3.5.1 (+READLINE +SECHASH +IPV6 +DEBUG) (Fedora 32) says the -a is ignored. Sep 7, 2020 at 10:39
15

The chrony equivalent to the ntpdate SERVER-ADDRESS command is:

    chronyd -q 'server SERVER-ADDRESS iburst'

Note that chronyd must not be already running, just as ntpd must not be running when setting the date with ntpdate.

1
  • After that I usually need an additional: sudo systemctl start chronyd; sudo chronyc -a 'burst 4/4'
    – olopopo
    Jun 3, 2021 at 15:37
10

In my setup, for various reasons, chronyd is disabled and we want to occasionally manually sync with an NTP server.

For this type of scenario, the command in Rob Newton's answer is the one that worked (thanks!).

Note that if you are querying the ntp pool, it is advisable to use the pool command, as in:

chronyd -q 'pool pool.ntp.org iburst'

See this question for additional details.

Also note that if the chronyd service is not running, the command sudo chronyc -a makestep in Richard Green's answer will not work, since it tries to communicate with the chronyd daemon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.