Red HatThis forum is for the discussion of Red Hat Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'd insert a "sleep 1" into the script. The while loop is spawning multiple date commands and due to the way time slicing is done it is possible that a later date command could complete and display to the screen before an earlier one. That is to say you may have run that got the date (Epoch) before another one did but then displayed the human readable conversion of Epoch AFTER the other one had displayed its conversion. The sleep 1 gives each date command time to complete.
You might want to run top and see how heavily loaded your CPU is. I doubt anything could CHANGE the system clock that quickly (even NTP) so it may be the date commands aren't actually finishing even in 1 second though that would be unusual. With a heavily loaded system I could see it occuring though.
I tried it on my FC4 system with the sleep 1 and didn't see the result you get.
this is a brand new machine. new installation. no load at all.
tried with sleep 2, 5, 10. same result.
I am just wondering if I used the right load? am I suppose to use AMD64 load. I don't think I need it.
Can't answer that because I've not used an AMD load for anything. All I've done is "Genuine Intel" in the x86 space. (Do have Debian on a PA-RISC box.).
You might want to check a couple of other things first.
First boot the system and go into the BIOS setup (usually hitting F2 or DEL when prompted) to check for settings on the hardware clock. If it gives choice for using UTC (Universal Time Code) go ahead and set it that way.
After booting back into the OS run "hwclock" to see the hardware clock time. Run date to see the "system" time. Set your system time with the date command then run "hwclock -systohc" to set your hardware clock to your system time.
Look through your cron files to insure nothing is running ntpdate (this is a command line to set date rather than requiring you to have ntpd running).
Do "ps -ef |grep ntp" just to be sure you don't see any ntp processes running. (I know you said it isn't configured but it never hurts to check.)