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

Crucial MX500 1TB 2.5" SATA III Internal SSD CT1000MX500SSD1
$99.99
Samsung 2.5" 870 EVO SSD SATA III 250GB 500GB 1TB Internet Solid State Drive Lot
$90.00
Samsung 860 EVO 250GB SSD MZ-76E250 2.5" SATA III Solid State Drive -
$39.99
Samsung New SSD 970 EVO Plus 2TB 1TB 500GB 250GB NVMe M2 Internal Hard Drive Lot
$79.99
Netac 2TB 1TB 512GB 256GB Internal SSD 2.5inch SATAIII Solid State Drive lot
$549.00
Samsung 256 GB Internal SATA SSD Fully Tested 50%-79% Health
$24.00
Fanxiang 256GB 512GB 1TB 2TB 4TB SSD Lot 2.5'' SATA Internal Solid State Drive
$42.99
Fanxiang 1/2/5/10Pcs 2.5'' SATA SSD Lot 1TB 2TB 4TB 512GB 256GB TLC Internal SSD
$129.99
SSD 2.5" SATA Hard Drive for Laptop Desktop Windows 10 pro 64 Pro Pre-installed
$42.00
EDILOCA EN880E 1TB M.2 NVMe PCIe Gen4 Internal SSD for Laptop/PC
$115.00