Results 1 to 19 of 19

Thread: Server time

  1. #1
    Join Date
    Aug 2002
    Posts
    1,632

    Server time

    Hi,

    i have change the server time on my RHE box with Cpanel but evry time that i reboot it the server lost the time setting, how can i fix this problem?

    thx

  2. #2
    I don't know any thing about cpanel, but how I sync my time:

    0 */2 * * * /usr/sbin/ntpdate -u -s -t 20 nist1.datum.com > /dev/null 2>&1

    This crontab sync time with nist2.datum.com every two hours. This crontab runs at root.

  3. #3
    Join Date
    Feb 2003
    Location
    Detroit
    Posts
    836
    the problem is your hardware clock is out of sync.

    You can use ntpdate or rdate to set your time with cron, but either run it at boot or use hwclock to set your hardware clock to the right time.
    managedway
    WE BUILD CLOUDS

    Cloud Computing | Fiber Optic Internet | Colocation

  4. #4
    Join Date
    Mar 2004
    Posts
    999
    I'm on Dual Xeon with Fedora Core 1. I have the same problem but I'm quite a noob to understand what you said. Can you explain it a little more simpler and step-by-step ? or any easy tutorial for it?
    When everything seems under control, you're just not going fast enough Mario Andretti, Racer

  5. #5
    Join Date
    Dec 2001
    Location
    NYC
    Posts
    1,902
    open up /etc/crontab and add what dnn said in it. that's pretty much it.

  6. #6
    Join Date
    Mar 2004
    Posts
    999
    - Open /etc/crontab via SSH?
    - Add exactly what dnn said or Do I've to edit the line somewhere?
    When everything seems under control, you're just not going fast enough Mario Andretti, Racer

  7. #7
    Join Date
    Mar 2004
    Posts
    999
    [Edit] I managed to open the crontab file, so should I add exactly what dnn said or Do I've to edit the line somewhere?
    When everything seems under control, you're just not going fast enough Mario Andretti, Racer

  8. #8
    Join Date
    Jul 2002
    Location
    Kuwait
    Posts
    10,573
    when u set the time via WHM it goes back also?
    Bashar Al-Abdulhadi - KuwaitNET Internet Services Serving customers since 1997
    Kuwait's First Webhosting and Domain Registration provider - an ICANN Accredited Registrar

    Twitter: Bashar Al-Abdulhadi

  9. #9
    Join Date
    Mar 2004
    Posts
    999
    Bashar,

    Thats the problem eh
    When everything seems under control, you're just not going fast enough Mario Andretti, Racer

  10. #10
    Join Date
    Jul 2002
    Location
    Kuwait
    Posts
    10,573
    bash
    export EDITOR="pico"
    crontab -e
    0*/ 2* * * /usr/sbin/ntpdate -u -s -t 20 nist1.datum.com > /dev/null2 >&1
    control X
    y
    enter

    do those command as root and if you want the time to be set as nist1.datum.com
    Bashar Al-Abdulhadi - KuwaitNET Internet Services Serving customers since 1997
    Kuwait's First Webhosting and Domain Registration provider - an ICANN Accredited Registrar

    Twitter: Bashar Al-Abdulhadi

  11. #11
    Join Date
    Mar 2004
    Posts
    999
    Bashar,

    I did exactly as you said and it dislpays an error:

    Code:
    crontab: installing new crontab 2004 from 61.11.112.20
    "/tmp/crontab.30176":2: bad day-of-month
    errors in crontab file, can't install.
    Do you want to retry the same edit? n
    crontab: edits left in /tmp/crontab.30176
    I want to set the time to GMT +5.30hrs.
    When everything seems under control, you're just not going fast enough Mario Andretti, Racer

  12. #12
    Join Date
    Jul 2002
    Location
    Kuwait
    Posts
    10,573
    Code:
    0 */2 * * * /usr/sbin/ntpdate -u -s -t 20 nist1.datum.com > /dev/null 2>&1
    this shouldbe it

    i'm not sure about the timezone settings of nist1.datum.com you need a timeserver to match yours i think
    Bashar Al-Abdulhadi - KuwaitNET Internet Services Serving customers since 1997
    Kuwait's First Webhosting and Domain Registration provider - an ICANN Accredited Registrar

    Twitter: Bashar Al-Abdulhadi

  13. #13
    Join Date
    Mar 2004
    Posts
    999
    Hmm Yeah, how do I find a timeserver that matches mine (GMT +5.30hrs) ?
    When everything seems under control, you're just not going fast enough Mario Andretti, Racer

  14. #14
    simply set the time in BIOS. OS always following the time from BIOS.
    kkj

  15. #15
    Join Date
    Mar 2004
    Posts
    999
    BIOS? Its a Dedicated Server eh!
    When everything seems under control, you're just not going fast enough Mario Andretti, Racer

  16. #16
    Join Date
    Apr 2003
    Location
    Melbourne, AU
    Posts
    539
    Originally posted by openXS
    Hmm Yeah, how do I find a timeserver that matches mine (GMT +5.30hrs) ?
    all NTP servers serve time in UTC. you have to adjust the timezone accordingly on your side (try tzconfig or similar).

  17. #17
    Join Date
    Mar 2004
    Posts
    999
    Run this command in your SSH prompt.

    #date -s 'Sat Jul 31 12:02 IST 2004'

    It should work.

    -----
    LoL, its me..Found a solution to my problem myself heh..thanks anyway!
    When everything seems under control, you're just not going fast enough Mario Andretti, Racer

  18. #18
    Join Date
    Aug 2004
    Location
    UK
    Posts
    50
    Originally posted by openXS
    Run this command in your SSH prompt.

    #date -s 'Sat Jul 31 12:02 IST 2004'

    It should work.

    -----
    LoL, its me..Found a solution to my problem myself heh..thanks anyway!
    Thanks for that

    I have been wondering how to change my server time for ages
    HostWithUs.co.uk
    Reliable Shared and Reseller Hosting

  19. #19
    Join Date
    Mar 2001
    Location
    California
    Posts
    332
    To see your hardware clock setting:
    hwclock --show

    To set your hardware clock from system time:
    hwclock --systohc

    To set your system time from the hardware clock:
    hwclock --hctosys

    Any confusion:
    man hwclock

Posting Permissions

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