Results 1 to 3 of 3

Thread: Problems with ntpdate by cron

Hybrid View

  1. #1

    Problems with ntpdate by cron

    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

  2. #2
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041

    Re: Problems with ntpdate by cron

    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.

    Quote 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

  3. #3

    Problems with ntpdate by cron

    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

Similar Threads

  1. Trying to debug a cron job
    By turbine in forum General Support
    Replies: 8
    Last Post: 11-20-2006, 02:29 PM
  2. Cron
    By rrijkse in forum Customising & Remastering
    Replies: 2
    Last Post: 07-28-2004, 05:43 AM
  3. Replies: 1
    Last Post: 04-01-2004, 03:37 AM
  4. cron
    By punk000 in forum General Support
    Replies: 1
    Last Post: 02-24-2003, 07:21 PM
  5. unknown cron job
    By tegan in forum General Support
    Replies: 2
    Last Post: 02-01-2003, 01:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Apple Mac Pro 2019 1TB OEM SSD Kit-832GB +128GB - 656-0122/ 656-0121 picture

Apple Mac Pro 2019 1TB OEM SSD Kit-832GB +128GB - 656-0122/ 656-0121

$69.99



Samsung 2.5

Samsung 2.5" 870 EVO SSD SATA III 250GB 500GB 1TB Internet Solid State Drive Lot

$60.00



Dell Latitude 14

Dell Latitude 14" Laptop Computer Intel i5 Up To 32GB RAM 1TB SSD Windows 11 Pro

$545.25



External SSD 1TB 2TB 4TB Portable Hard Drive USB 3.0 Type-C High Speed PC Mac picture

External SSD 1TB 2TB 4TB Portable Hard Drive USB 3.0 Type-C High Speed PC Mac

$19.99



SK hynix PC801 1TB M.2 NVMe PCIe Gen4 x4 Internal SSD HFS512GDE9X081N picture

SK hynix PC801 1TB M.2 NVMe PCIe Gen4 x4 Internal SSD HFS512GDE9X081N

$90.00



SAMSUNG T7 Portable SSD 1TB Indigo Blue USB 3.2 Gen2 External MU-PC1T0H/AM picture

SAMSUNG T7 Portable SSD 1TB Indigo Blue USB 3.2 Gen2 External MU-PC1T0H/AM

$159.99



1TB Kingston DataTraveler Max DTMAX/1TB USB Type-C Flash Drive picture

1TB Kingston DataTraveler Max DTMAX/1TB USB Type-C Flash Drive

$86.95



Acer Predator Helios Neo 16S AI 16

Acer Predator Helios Neo 16S AI 16" i9 275HX 2S RTX 5070 Ti 32GB 1TB SSD Refurb

$1746.47



fanxiang S660 1TB PCIe 4.0 NVMe M.2 2280 Internal SSD w/ Heatsink Gray picture

fanxiang S660 1TB PCIe 4.0 NVMe M.2 2280 Internal SSD w/ Heatsink Gray

$120.00



Dell Latitude 14

Dell Latitude 14" Laptop Computer Intel i7 Up To 32GB RAM 1TB SSD Windows 11 Pro

$330.73