howto start ntpdate after restart ?


Results 1 to 3 of 3

Thread: howto start ntpdate after restart ?

  1. #1
    Join Date
    Sep 2002
    Posts
    125

    howto start ntpdate after restart ?

    hi

    on my debian sarge stable I have in cron.hourly the following entry:
    Code:
    debian:~# cat /etc/cron.hourly/ntpdate
    #!/bin/sh
    
    /usr/sbin/ntpdate -v 130.133.1.10 131.188.3.220 193.67.79.202 ; /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
    ccc
    Last edited by ccc; 08-13-2006 at 06:41 PM.

  2. #2
    Join Date
    Apr 2003
    Location
    Buenos Aires, Argentina
    Posts
    4,219
    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:

    http://linuxreviews.org/beginner/Bas.../en/c3526.html
    http://tille.xalasys.com/training/ba...tml#sect_07_01

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

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

    #!/bin/sh
    /usr/sbin/ntpdate time.cableol.net && /sbin/hwclock –-systohc


    ** time.cableol.net/valiant.cableol.net 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
  •