Results 1 to 3 of 3

Thread: Problems with ntpdate by cron

  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
  •  


Commodore 64 Serial Cable 6PIN DIN 1541 1571 C64 128 C128 Disk Drive Printer USA picture

Commodore 64 Serial Cable 6PIN DIN 1541 1571 C64 128 C128 Disk Drive Printer USA

$10.49



TeensyROM+ TR+ v0.4 Cartridge for C64/128 - w/ Case & 32GB SD Preloaded picture

TeensyROM+ TR+ v0.4 Cartridge for C64/128 - w/ Case & 32GB SD Preloaded

$89.50



Commodore VIC-20 Diagnostic Cartridge & Test Harness Set - USA seller picture

Commodore VIC-20 Diagnostic Cartridge & Test Harness Set - USA seller

$39.99



Commodore 64 Dead Test & Diagnostic Cartridge & Test Harness Set - USA seller picture

Commodore 64 Dead Test & Diagnostic Cartridge & Test Harness Set - USA seller

$39.99



Commodore 64 Vintage Computer System *PARTS/AS IS* picture

Commodore 64 Vintage Computer System *PARTS/AS IS*

$70.00



Commodore 128 C128 Computer FOR PARTS / REPAIR Untested Missing Key No Cords picture

Commodore 128 C128 Computer FOR PARTS / REPAIR Untested Missing Key No Cords

$149.99



COMMODORE 64 - CASE & KEYBOARD ONLY - NO MOTHERBOARD - TABS INTACT picture

COMMODORE 64 - CASE & KEYBOARD ONLY - NO MOTHERBOARD - TABS INTACT

$49.00



Commodore 64 disk drive - enhancer 2000 & 30 disks picture

Commodore 64 disk drive - enhancer 2000 & 30 disks

$110.00



Commodore 64 Drive Alignment & Utility Diskette picture

Commodore 64 Drive Alignment & Utility Diskette

$9.99



Commodore OS USB | Bootable LIVE + Install | The Ultimate Gaming Linux OS | NEW picture

Commodore OS USB | Bootable LIVE + Install | The Ultimate Gaming Linux OS | NEW

$11.99