Hey guys, this is an easy one, How do I set the time on my linux box-don't seem to figure out how? Paul. o ~ o ~ o ~ o ~ o ~ o ~ o ~ o ~ o ~ o ~ o Julius Paul Ikanza Systems Administrator New Vision Printing & Publishing Company email: mailto:pikanza@newvision.co.ug pikanza@newvision.co.ug
On 01.09.04,14:08, Paul Ikanza wrote:
Hey guys, this is an easy one, How do I set the time on my linux box-don't seem to figure out how?
Paul.
You can do this as root:
hwclock --set --date=11:30 (set the right time here)
and
hwclock --hctosys
- Jostein
--
Jostein Berntsen
On Wed, 1 Sep 2004 21:26:51 +0200
Jostein Berntsen
On 01.09.04,14:08, Paul Ikanza wrote:
Hey guys, this is an easy one, How do I set the time on my linux box-don't seem to figure out how?
Paul.
You can do this as root:
hwclock --set --date=11:30 (set the right time here)
and
hwclock --hctosys
There are a couple of options you also need to set.
The first is to decide whether your system should be set to Local Time
or UCT Time. And set the correct time zone. Yast->System->Select Time
Zone.
If your system dual boots with a Microsoft OS then set the clock to
local time, but if you do not dual boot, set it to UTC (eg. GMT). GMT is
better since your daylight savings time will toggle correctly.
Note that the hwclock(8) command will update the CMOS clock.
--
Jerry Feldman
Sorry for the waste of bandwidth on this. I found ntp john -- ############################################# # John N. Alegre # Andante Systems # Web Hosting # Web Site Development # www.johnalegre.net #############################################
Is there a way to auto sync time in SuSE? I also have OS X in my LAN that are sync'ed. Is there any known software to sync SuSE with one of those systems. Thanks john On Wednesday 01 September 2004 14:26, Jostein Berntsen wrote:
On 01.09.04,14:08, Paul Ikanza wrote:
Hey guys, this is an easy one, How do I set the time on my linux box-don't seem to figure out how?
Paul.
You can do this as root:
hwclock --set --date=11:30 (set the right time here)
and
hwclock --hctosys
- Jostein
-- Jostein Berntsen
On Friday 03 September 2004 10:30 am, John N. Alegre wrote:
On Wednesday 01 September 2004 14:26, Jostein Berntsen wrote: Hi,
To do time automagically, become root, goto Control Cntr >YAST > System
Runlevel editor >Runlevel Properties .... then scroll down to XNTPD and turn it on for runlevels 2, 3, and 5. Use "Set/Reset" to make it "ON" for all reboots.
The edit /etc/ntp.conf to include lines like these: ## ## Outside source of synchronized time ## ## server xx.xx.xx.xx # IP address of server server ntp2.usno.navy.mil server tock.usno.navy.mil server time.berkeley.netdot.net server ntp-1.mcs.anl.gov ## at that place in the file. These particular servers are working great for me, but you will many more that may be better for you. Then go RTFM, PIN, MAN and How-to's just to make Patrick happy, because a grumpy Patrick is bad for the list PeterB p.s. {whispered} "pay it forward" -- -- Proud to use SuSE Linux, since 5.2 Loving using SuSE Linux 9.1 MyBlog http://vancampen.org/blog/ Currently listening to Joseph Campbell http://www.jcf.org/ Free D/Ls after free registration --
* Peter B Van Campen
## server xx.xx.xx.xx # IP address of server server ntp2.usno.navy.mil server tock.usno.navy.mil server time.berkeley.netdot.net server ntp-1.mcs.anl.gov ##
at that place in the file. These particular servers are working great for me, but you will many more that may be better for you.
perhaps a better choice of location would be: server us.pool.ntp.org make as many entries as you want checks, at least four. I believe that the ntp.org people recommend the use of 'pool' now.
Then go RTFM, PIN, MAN and How-to's just to make Patrick happy, because a grumpy Patrick is bad for the list
Why, thankyou for the accolades, Peter. :^)
From WordNet (r) 2.0 [wn]:
sarcasm n : witty language used to convey insults or scorn; "he used sarcasm to upset his opponent"; "irony is wasted on the stupid"; "Satire is a sort of glass, wherein beholders do generally discover everybody's face but their own"--Johathan Swift [syn: {irony}, {satire}, {caustic remark}]
p.s. {whispered} "pay it forward"
remember the Fram commercial...... -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/photos
On Friday 03 September 2004 03:41 pm, Patrick Shanahan wrote:
* Peter B Van Campen
[09-03-04 15:12]: .... <snip> .... ## server xx.xx.xx.xx # IP address of server server ntp2.usno.navy.mil server tock.usno.navy.mil server time.berkeley.netdot.net server ntp-1.mcs.anl.gov ##
at that place in the file. These particular servers are working great for me, but you will many more that may be better for you.
perhaps a better choice of location would be: server us.pool.ntp.org
make as many entries as you want checks, at least four.
I believe that the ntp.org people recommend the use of 'pool' now.
Then go RTFM, PIN, MAN and How-to's just to make Patrick happy, because a grumpy Patrick is bad for the list
Why, thankyou for the accolades, Peter. :^)
From WordNet (r) 2.0 [wn]:
sarcasm n : witty language used to convey insults or scorn; "he used sarcasm to upset his opponent"; "irony is wasted on the stupid"; "Satire is a sort of glass, wherein beholders do generally discover everybody's face but their own"--Johathan Swift [syn: {irony}, {satire}, {caustic remark}]
p.s. {whispered} "pay it forward" Dear Pat,
Good tips, Thanks! Don't put more into what I type than I meant; take my words at face value. I only wanted to try to spare the OP some of your typical advice. :o) PeterB p.s. the Pay It Forward was for the OP btw -- -- Proud to use SuSE Linux, since 5.2 Loving using SuSE Linux 9.1 MyBlog http://vancampen.org/blog/ Currently listening to Joseph Campbell http://www.jcf.org/ Free D/Ls after free registration --
* Peter B Van Campen
Good tips, Thanks!
Don't put more into what I type than I meant; take my words at face value. I only wanted to try to spare the OP some of your typical advice. :o)
But, you are assuming and you know what they say about 'assume'. That advice is only given when the information is presented fairly readily available and/or appears to not have been tried *first*. The 'pool' parameter is not printed in bold in the first three or four paragraphs. I learned of it myself in this forum about a year ago. My son would like for me to help him service his riding mower. Translation: He wants me to do it. Result: He *did* it and I helped. Of course, he could have asked *me* to service the mower. A different situation, entirely. But he is my son.
p.s. the Pay It Forward was for the OP btw
k, :^) -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/photos
The Wednesday 2004-09-01 at 21:26 +0200, Jostein Berntsen wrote:
hwclock --set --date=11:30 (set the right time here)
and
hwclock --hctosys
Also, remember to delete '/etc/adjtime' - don't worry, it will be recreated. This is to avoid weird adjustments when booting next time. -- Cheers, Carlos Robinson
Paul Ikanza wrote:
How do I set the time on my linux box-don't seem to figure out how?
Adjusting the KDE clock is rather self-explaining, but here's a good old-fashioned command line version: ;-) 'su' to root delete /etc/adjtime date 09011500 (as an example) hwclock --systohc This creates a new /etc/adjtime file. A week or so later do, again as root: date 09081500 (as an example) hwclock --systohc hwclock now calculates how much your clock is running too fast or too slow, and stores this information in /etc/adjtime. After this, each time you are running, as root, hwclock --adjust the time is adjusted according to this information. You could have this command executed automatically on startup, or make it a cron job. More info: man hwclock. SH
Sjoerd Hiemstra wrote:
Adjusting the KDE clock is rather self-explaining, but here's a good old-fashioned command line version: ;-)
'su' to root delete /etc/adjtime date 09011500 (as an example) hwclock --systohc
This creates a new /etc/adjtime file. A week or so later do, again as root:
date 09081500 (as an example) hwclock --systohc
hwclock now calculates how much your clock is running too fast or too slow, and stores this information in /etc/adjtime. After this, each time you are running, as root,
hwclock --adjust
the time is adjusted according to this information. You could have this command executed automatically on startup, or make it a cron job. More info: man hwclock.
SH
I was trying to fix a clock systematic drift in an old 486 running debian stable, and found this interesting text about hwclock: ---------- File: /usr/share/doc/util-linux/README.Debian.hwclock.gz .... Issues with hwclock --adjust: hwclock has a facility to try to correct for systematic drift in the hardware clock, accessed by hwclock --adjust. This facility is *dangerous* because it has a severe drawback: it assumes that no program other than hwclock --systohc will ever be used to change the hardware clock. This assumption is often false, as many common utilities such as ntp, chrony, as well as your computer's System Setup BIOS program, and any other OS you have in your machine will change the clock. Also, if hwclock --adjust is used, one must make sure the drift file (/etc/adjtime) is deleted every time the system clock is set to a very different value (even if you're using hwclock itself to do it!), or the drift computation might become invalid and cause the hardware clock to be incorrectly set the next time hwclock --adjust is used. hwclock currently does not perform any sort of sanity checks in the values it uses to compute the drift file, and will corrupt your clock time by potentially very large amounts if anything goes wrong. Don't use the hwclock --adjust facility, refer to alternate (and much safer) programs such as ntp or chrony if you need precision timekeeping. ---------- So, if you're running a server, on all the time, probably hwclock will work fine. Otherwise, better choose anoter way to keep your clock in sync. -- Marcos Lazarini
The 2004-09-18 at 00:13 -0300, Marcos Vinicius Lazarini wrote:
I was trying to fix a clock systematic drift in an old 486 running debian stable, and found this interesting text about hwclock: ---------- File: /usr/share/doc/util-linux/README.Debian.hwclock.gz .... Issues with hwclock --adjust:
hwclock has a facility to try to correct for systematic drift in the hardware clock, accessed by hwclock --adjust. This facility is *dangerous* because it has a severe drawback: it assumes that no program other than hwclock --systohc will ever be used to change the hardware clock.
That's correct.
This assumption is often false, as many common utilities such as ntp, chrony, as well as your computer's System Setup BIOS program, and any other OS you have in your machine will change the clock.
Exactly. This is specially true for dos/windows. However, if you are aware of the problem, you take your measures. Notice that if you use ntp, the suse scripts will automatically call hwclock at system shutdown: this is taken into account, no need to do manual adjustements.
Also, if hwclock --adjust is used, one must make sure the drift file (/etc/adjtime) is deleted every time the system clock is set to a very different value (even if you're using hwclock itself to do it!), or the drift computation might become invalid and cause the hardware clock to be incorrectly set the next time hwclock --adjust is used.
Absolutely correct. Notice that several people have recomended deleting that file after setting up the clock: it is a known issue.
hwclock currently does not perform any sort of sanity checks in the values it uses to compute the drift file, and will corrupt your clock time by potentially very large amounts if anything goes wrong.
Yes. If it happens, delete the adjtime file, and problem solved.
Don't use the hwclock --adjust facility, refer to alternate (and much safer) programs such as ntp or chrony if you need precision timekeeping.
Then you have to delete or edit som suse scripts, because it is called by default. You can find my writeup on how suse handles the clock in the unofficial suse faq, howtos section. -- Cheers, Carlos Robinson
Carlos E. R. wrote:
Don't use the hwclock --adjust facility, refer to alternate (and much safer) programs such as ntp or chrony if you need precision timekeeping.
Then you have to delete or edit som suse scripts, because it is called by default.
You can find my writeup on how suse handles the clock in the unofficial suse faq, howtos section.
I don't want to create controversy, but to me this seems wrong - someone running suse in a dual-boot computer (e.g. trial period, with windows) would get clock synchronization problems (unless he uses ntp on both systems). A starting user, and he will have one more 'barrier' to cross, one more problem to solve. Should this be (at least) the opposite? -- Marcos Lazarini
On Sat, 18 Sep 2004 23:24:39 -0300
Marcos Lazarini
I don't want to create controversy, but to me this seems wrong - someone running suse in a dual-boot computer (e.g. trial period, with windows) would get clock synchronization problems (unless he uses ntp on both systems). A starting user, and he will have one more 'barrier' to cross, one more problem to solve. Should this be (at least) the opposite? If SuSE is set up as local time, there should not be a problem even if Windows is not using a sync program. -- Jerry Feldman
Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
On Sunday 19 Sep 2004 14:38, Jerry Feldman wrote:
On Sat, 18 Sep 2004 23:24:39 -0300
Marcos Lazarini
wrote: I don't want to create controversy, but to me this seems wrong - someone running suse in a dual-boot computer (e.g. trial period, with windows) would get clock synchronization problems (unless he uses ntp on both systems). A starting user, and he will have one more 'barrier' to cross, one more problem to solve. Should this be (at least) the opposite?
If SuSE is set up as local time, there should not be a problem even if Windows is not using a sync program.
Set suse to get correct time and whatever windBloZe thinks well who cares really lets face it .. Pete -- Linux user No: 256242 Machine No: 139931 G6NJR Pete also MSA registered "Quinton 11" A Linux Only area Happy bug hunting M$ clan PGN
The Saturday 2004-09-18 at 23:24 -0300, Marcos Lazarini wrote:
You can find my writeup on how suse handles the clock in the unofficial suse faq, howtos section.
I don't want to create controversy, but to me this seems wrong - someone running suse in a dual-boot computer (e.g. trial period, with windows) would get clock synchronization problems (unless he uses ntp on both systems). A starting user, and he will have one more 'barrier' to cross, one more problem to solve. Should this be (at least) the opposite?
(The long explanation is where I said above, or in this list archive sometime ago) No, there is no problem except: you manually set up the time when inside linux and forget to delete the adjtime file and/or to adjust the CMOS clock at the same time. It usually happens when touching the clock with kde. Remember that Linux is unix type, and you are not supposed to meddle with such things as the clock, unless you are root, and you are root if you know your stuff :-p Also, there may be problems if you use ntp and dual boot, because windows is not so strict with the clock handling as is linux, and may unset it out of syncronism. Not in all cases, any way, or the list would be full of complaints of users with bad clocks :-) -- Cheers, Carlos Robinson
participants (12)
-
Carlos E. R.
-
James Knott
-
Jerry Feldman
-
John N. Alegre
-
Jostein Berntsen
-
Marcos Lazarini
-
Marcos Vinicius Lazarini
-
Patrick Shanahan
-
Paul Ikanza
-
Peter B Van Campen
-
peter Nikolic
-
Sjoerd Hiemstra