Results 1 to 2 of 2

Thread: linux server Automatic time update

  1. #1
    Join Date
    Apr 2008
    Posts
    438

    linux server Automatic time update

    Automatic time update
    If you have a server that day and night to run if you do not always check that your system still displays the correct time. With the script you can set each day your server is the system clock update.

    This tweak is applied to any Linux distribution, using cronjobs.

    First we make a small file with your favorite text editor and type the following text:
    Code:
    #! / bin / sh
    ntpdate pool.ntp.org
    And stores it in eg / usr / local / bin as update_
    time.
    This file must then be made executable:
    Code:
    $ chmod + x update_
    time


    Then go to / etc and open the crontab file (must be root / super user).
    As you add the following line under # run-parts:
    Code:
    # Run-parts
    0 4 * * * root / usr / local / bin / update_time


    This file in turn.
    The five positions (0 4 * * *) for 'root' to where you want the script is executed:
    Code:
    0 / / The 1st position indicates the minute of the time the script is executed
    4 / / The second digit indicates the hour (ie at 4 am)
    * / / The third on the day of the month (* = any day of the month)
    * / / The fourth which month (* = any day of the month)
    * / / The fifth position indicates the day of the week (* = any day of the week)
    In other words, this code ensures that every night at 04:00 pm the script to the location / usr / local / bin / update_
    time is executed by user root. If you are sure that your server every day at the time

  2. #2
    Join Date
    Apr 2008
    Posts
    586

    Re: linux server Automatic time update

    rdate [-p] [-s] [-u] [-l] [host...]

    rdate connects to an RFC 868 time server over a TCP/IP network, printing the returned time and/or sets the system clock.
    OPTIONS

    -p
    Print time returned by the remote machine.
    -s
    Set system time to the returned time.
    -u
    Use UDP instead of TCP as the transport.
    -l
    Use syslog to output errors (cron.warning) and output (cron.info).

    We will use this to set the time.
    rdate -s time.nist.gov

    There are other servers/hosts that you can retrieve the time from. This is the one we use on the east coast.

    or you can use UCLA's

Similar Threads

  1. Nokia N8 Automatic Time Update trying to connect WLAN
    By brynhildur in forum Portable Devices
    Replies: 5
    Last Post: 07-01-2011, 10:19 AM
  2. Replies: 1
    Last Post: 08-11-2010, 02:26 PM
  3. Automatic time setting on iphone
    By Shakaal in forum Portable Devices
    Replies: 4
    Last Post: 29-09-2010, 09:02 PM
  4. Replies: 1
    Last Post: 18-07-2010, 01:38 AM
  5. Automatic software update for Mac OS X 10.5.5 Combo Update
    By gygabite in forum Operating Systems
    Replies: 2
    Last Post: 16-09-2008, 06:42 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,868,465.48196 seconds with 17 queries