Create a separate bash script with the ntpdate command, and call that from cron. For some reason, calling commands directly from cron doesn't work.
Originally Posted by michael.doepper
Hello everyone!
I try to syncronize the system-time by using cron an ntpdate.
The concerning line in crontab is 1 * * * * ntpdate -s ip-address of time server
and by using the option -s the logging output is diverted to /var/log/syslog. In the next line
you see such a logging:
Aug 1 09:01:01 solarlinux /USR/SBIN/CRON[29560]: (root) CMD (ntpdate -s ...)
But if I check the remainig offset by ntpdate -q ip-address of time server,
its value doesn't become smaller, it seems as if ntpdate executed by cron does not
syncronize the time. Only if I execute the command manually in a shell, the offset
becomes notable smaller.
Does anybody have an idea how to solve this problem?
Thanks in advance!
Michael Doepper
Create a separate bash script with the ntpdate command, and call that from cron. For some reason, calling commands directly from cron doesn't work.
Originally Posted by michael.doepper
Thanks to Dave Bechtel for the response. But even if a seperate bash script was used, I had no success.
I found out, that the command in cron has to contain the full path of the command, instead of ntpdate
/usr/sbin/ntpdate has to be run.
Best regards
Michael Dopper

USB 3.0 Flash Drive 32GB 64GB 128GB Memory Stick Thumb Stick Lot Pack
$826.09
Microsoft Office 2021 Pro Plus USB for 1PC Windows 10 & 11
$62.50
TF/SD Card Adapter Camera Reader Android Type-c For iPhone17 Pro Max Plusm lot
$573.98
LOT OF 3 Micron 16GB 2Rx8 PC4-3200AA DDR4 ECC Server Memory
$255.00
128GB (4x32GB) SK hynix DDR4 PC4-2666V RDIMM ECC Server Ram HMA84GR7CJR4N-VK
$799.00
16GB Samsung M393A2K43DB2-CTD7Q DDR4 PC4-2666V RDIMM Server Memory RAM
$79.99
USB 3.0 Micro SD SDHC TF Card Reader Memory Adapter for PC Laptop Camera lot
$3.75
Samsung 64GB 2Rx4 DDR4 2933Y RAM M393A8G40MB2-CVFBY
$550.00
Wholesale 5/10/100PCS 1GB 2GB 4GB 8GB 16GB 32GB USB 2.0 Flash Drive Memory Stick
$378.00
5 in 1 Memory Card Reader USB 3.0 OTG Adapter SD Card Reader For iPhone/iPad LOT
$9.99