howto start ntpdate after restart ?

Results 1 to 3 of 3

Thread: howto start ntpdate after restart ?

  1. #1
    Join Date
    Sep 2002

    howto start ntpdate after restart ?


    on my debian sarge stable I have in cron.hourly the following entry:
    debian:~# cat /etc/cron.hourly/ntpdate
    /usr/sbin/ntpdate -v ; /sbin/hwclock --systohc > /dev/null 2>&1
    because I'll synchronize the system time every hour,

    but the machine has a wirelless card with wpa encryption and the cron will start before the internet connection, so the system is hanging each time during the restart.

    could someone help me pls to solve this problem ?
    maybe to put "if any" to this script ?

    kind regards
    Last edited by ccc; 08-13-2006 at 06:41 PM.

  2. #2
    Join Date
    Apr 2003
    Buenos Aires, Argentina
    It should be easy to accomplish that.. what you need to check is that "if" there's a file.. or a process running, or whatever, run the rest of the commands or not. Check the following links:

    Hope it helps bro.
    "All the drugs in this world won't save you from yourself..."

  3. #3
    Join Date
    Aug 2006
    Middlesbrough, England
    This is my /etc/cron.daily/timesync bash script:

    /usr/sbin/ntpdate && /sbin/hwclock -systohc

    ** is NTLs NTP server here in the UK.
    This works perfect for me on a 24 hourly update. Note the missing '> /dev/null 2>&1'

Posting Permissions

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