Find the answer to your Linux question:
Results 1 to 5 of 5
$ cat test.sh echo `date +'%Y%m%d %T'` " c start" echo `date +'%Y%m%d %T'` " c done " I run the script above for many time and got the wired ...
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    3

    Unhappy Help me about time error

    $ cat test.sh
    echo `date +'%Y%m%d %T'` " c start"
    echo `date +'%Y%m%d %T'` " c done "

    I run the script above for many time and got the wired error for linux time:

    $ sh test.sh
    20090510 15:58:23 c start
    20090510 15:58:23 c done
    $ sh test.sh
    20090510 15:58:30 c start
    20090510 15:58:30 c done
    $ sh test.sh
    20090510 15:58:30 c start
    20090510 15:58:30 c done
    $ sh test.sh
    20090510 15:58:31 c start
    20090510 15:58:31 c done
    $ sh test.sh
    20090510 15:58:31 c start
    20090510 15:58:31 c done
    $ sh test.sh
    20090510 15:58:32 c start
    20090510 15:58:32 c done
    $ sh test.sh
    20090510 15:58:33 c start
    20090510 15:58:33 c done
    $ sh test.sh
    20090510 15:58:33 c start
    20090510 15:58:33 c done
    $ sh test.sh
    20090510 17:11:52 c start <-------------see this
    20090510 15:58:34 c done


    If I repeatedly run "date" it will get the same error, and this error seems to be happen randomly without any pattern to analysis.

    Any one can help me about this ? thank alot~

  2. #2
    Just Joined!
    Join Date
    May 2009
    Posts
    3
    date version

    date (GNU coreutils) 5.97
    Copyright (C) 2006 Free Software Foundation, Inc.

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Neat! You've discovered time travel!
    Really, I've never seen this. My date is the same version as yours.
    Ok. I made the same test.sh that you show and tried it a LOT of times. No problems here. Maybe it is a hardware problem? Or an ntp problem? Don't know, but as I said, I cannot reproduce it on my system - Intel S5000XVN mb, dual E5450 xeon processors, 8GB RAM, running CentOS 5.3 with latest kernel, updated yesterday.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. #4
    Just Joined!
    Join Date
    May 2009
    Posts
    3
    Quote Originally Posted by Rubberman View Post
    Neat! You've discovered time travel!
    Really, I've never seen this. My date is the same version as yours.
    Ok. I made the same test.sh that you show and tried it a LOT of times. No problems here. Maybe it is a hardware problem? Or an ntp problem? Don't know, but as I said, I cannot reproduce it on my system - Intel S5000XVN mb, dual E5450 xeon processors, 8GB RAM, running CentOS 5.3 with latest kernel, updated yesterday.
    thanks for ur help, Maybe it is the linux configuration that lead to this situation.

    I have runed the script on other linux , it doesn't error. I am confussed , but thanks for ur help~

  5. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Quote Originally Posted by carroty View Post
    thanks for ur help, Maybe it is the linux configuration that lead to this situation.
    I have runed the script on other linux , it doesn't error. I am confussed , but thanks for ur help~
    As I suggested, this could simply be a glitch in the real-time clock of the system that exhibits this behavior. I would also suggest that you run extended diagnostics on the system to see if there is a problem with the motherboard and clock.

    Re. your comment that it doesn't occur on other Linux. Do you mean that it doesn't happen with another version of Linux running on the same computer system? Or that it doesn't happen on another computer system running Linux? The distinction is important.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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