-
Senior Member
registered user
Updating local pc clock from a atomic clock site???
I tried locating man pages, and info pages on the subject, I think the command was "dt" or some other package that was specifically designed for updating the pc hardware clock - my problem is that when I was looking for this information, which has hit the "back burner" because of my ALSA sound issue, I could never find the "server" to get the local time.
Does anyone, or has anyone, setup some kind of script or access, that can demonstrate the use of these packages - and can show me a list of servers to get the atomic clock time, update the local pc hardware clock, and which server I can use for my local time zone - Central Time Zone - I do honor daylight savings as well, being in Wisconsin, USA.
Thanks for any assistance in the "minor" issue,
Cuddles
-
Senior Member
registered user
To sync your local clock you can say:
Code:
ntpdate name.of.some.ntp.server
Back home I have to use:
Code:
ntpdate -u name.of.some.ntp.server
because my isp blocks the normal ports.
Google for "public ntp server" to find some server near you.
-
Senior Member
registered user
Windos_No_Thanks,
I don't think this is working... I did a googe, and located three "secondard" sites, all of them reported to use the dns because the IP numbers can change... This is the output:
root@Polaris:/home/cuddles# ntpdate -u ntp1.cs.wisc.edu
10 Mar 07:59:34 ntpdate[8785]: sendto(128.105.39.11): Operation not permitted
10 Mar 07:59:35 ntpdate[8785]: sendto(128.105.39.11): Operation not permitted
10 Mar 07:59:36 ntpdate[8785]: sendto(128.105.39.11): Operation not permitted
10 Mar 07:59:37 ntpdate[8785]: sendto(128.105.39.11): Operation not permitted
10 Mar 07:59:38 ntpdate[8785]: no server suitable for synchronization found
root@Polaris:/home/cuddles# ntpdate ntp3.cs.wisc.edu
10 Mar 08:00:01 ntpdate[8786]: sendto(128.105.37.11): Operation not permitted
10 Mar 08:00:02 ntpdate[8786]: sendto(128.105.37.11): Operation not permitted
10 Mar 08:00:03 ntpdate[8786]: sendto(128.105.37.11): Operation not permitted
10 Mar 08:00:04 ntpdate[8786]: sendto(128.105.37.11): Operation not permitted
10 Mar 08:00:05 ntpdate[8786]: no server suitable for synchronization found
root@Polaris:/home/cuddles# ntpdate ntp3.sf-bay.org
10 Mar 08:00:22 ntpdate[8796]: sendto(206.55.70.42): Operation not permitted
10 Mar 08:00:23 ntpdate[8796]: sendto(206.55.70.42): Operation not permitted
10 Mar 08:00:24 ntpdate[8796]: sendto(206.55.70.42): Operation not permitted
10 Mar 08:00:25 ntpdate[8796]: sendto(206.55.70.42): Operation not permitted
10 Mar 08:00:26 ntpdate[8796]: no server suitable for synchronization found
All three sites come up with the same error, with or without the "-u" - I also have ntp set in my firewall for access. Am I missing something? (again?)
Thanks,
Cuddles
-
Senior Member
registered user
OOPS -=- spoke too soon, I didn't have ntp set in my firewall, unfortunately, when I ran the servers (which are local based here in Wisconsin) - it threw my clock off by +7 hours - do I need to supply some sort of GMT variable? (because I think that is exactly what my "offset" is)
Now that my hardware clock thinks its 3:10 PM, when it actually should be 8:10 AM - I can poke the time change, but I was looking for a quick shell script to run this under to update the clock...
Thanks for any help,
Cuddles
-
Senior Member
registered user
More information needed...
I setup a nice shell script to enter all the info of the ntpdate command, currently got it now to within one hour ahead of my time - so I am getting closer - my STATE isn't even on the list, let alone a city (for setting my time zone) I am currently set to Thunder Bay - which I would guess, is one hour ahead of me...
Problem is that if I run the shell script from a user other than root, I get the message "you are not in the sudoers file, this incident will be reported" - I have the "sudo" infront of the command in the script.
I already added my users into the sudoers file, with the "proper" use of visudo - but it doesn't appear to be loading the changes I made. What gives?
ALSO, how can I make my script shell command "local" to a standard command, like kwrite or something???
I know, why does everything I do require six posts, and problems, I don't know, I guess I am just "lucky" I guess???
Thanks ahead of time,
Cuddles
-
Senior Member
registered user
I'm starting to get the hang of this, sooner, or later...
Figured out what a mucked up in the sudoers file, and now my "users" can run as sudo - now...
So, I guess the only thing I still need to know, is, how can I get a shell script in a location that any of my "sudo" users can run my shell script that I have made to time adjust through ntpdate???
BTW - I found a time zone that worked - It was a city that - I guess - borders Wisconsin and another state - but the result is that the city is in my time zone - heck of a lot better than London and Los Angels, and a whole slew of other time zones that were set by default in the clock - time zone - settings...
Give a girl enough rope, and she just might find another way to hang herself - or in this case - give a girl enough time, and she might just find the answer on her own [giggle]
Cuddles
-
You can just run it at startup without the need to sudo.
Here's a nice short how-to:
http://www.desktop-linux.net/debian-rclocal.htm
EDIT: This would though need a cable or ADLS connection
-
Senior Member
registered user
Markus,
Sorry to say, nope, dial-up connection only - so the auto-start on boot time adjust isn't going to work...
So, the querry still stands, how and where do I place a shell script that can be accessed by any user. Permissions have already been set for all my users to run the script, and sudo has been enabled on these users as well...
Cuddles
-
Senior Member
registered user
Originally Posted by
Cuddles
So, the querry still stands, how and where do I place a shell script that can be accessed by any user. Permissions have already been set for all my users to run the script, and sudo has been enabled on these users as well...
Umm, you could just put it in root's crontab instead and perhaps add something in the beginning of it so that it aborts if it doesn't have network connectivity.
-
Senior Member
registered user
--First of all, you should run ' /usr/sbin/tzconfig ' and set your local timezone.
--The ONLY person who should be updating the machine's clock, is ROOT. Don't give out sudo permissions to just anyone - restrict it to maybe 1-2 other people at the most.
--Here is a copy of the script I use; you should be OK with running the script about once a month. Unless your CMOS battery is dying or something, you really --don't-- need to sync the time all that often.
BEGIN /root/bin/timesync
Code:
#!/bin/sh
date
ntpdate -s pool.ntp.org
date
#ntp1.linuxmedialabs.com
# pool.ntp.org
# ntp1.tummy.com - CO
# louie.udel.edu - DElwr
# ntp.shorty.com - GA
# inetd's timeserver is port 37; use ' rdate p233 '
--Once you have your "master server's" time set, you can edit its /etc/inetd.conf and uncomment the following lines:
Code:
daytime stream tcp nowait root internal
daytime dgram udp wait root internal
time stream tcp nowait root internal
time dgram udp wait root internal
--Then, if you need to, ' /etc/init.d/inetd start ' on the server as root. This should shed some light on the comment at the end of the above script; if you have inetd running with those services, you can go to another computer on the network (running Linux of course) and just ' rdate insert-name-of-internet-connected-box-here '. You may have to ' apt-get install rdate ' on the client(s); I forget if it comes on the live-cd.
--The nice thing about this is that only the master server needs to be updated via ntp; the other clients can then set their time from it using rdate.
--However, I wouldn't leave inetd running unless you have to; it opens up ports. I only start it when I need it, personally.
--Best wishes.
Originally Posted by
Cuddles
Markus,
Sorry to say, nope, dial-up connection only - so the auto-start on boot time adjust isn't going to work...
So, the querry still stands, how and where do I place a shell script that can be accessed by any user. Permissions have already been set for all my users to run the script, and sudo has been enabled on these users as well...
Cuddles
Similar Threads
-
By riechert in forum General Support
Replies: 0
Last Post: 06-24-2004, 07:43 PM
-
By riechert in forum Hdd Install / Debian / Apt
Replies: 0
Last Post: 06-24-2004, 06:41 AM
-
By evirus in forum General Support
Replies: 7
Last Post: 05-07-2004, 10:46 PM
-
By lmd in forum General Support
Replies: 0
Last Post: 02-13-2004, 12:18 AM
-
By LordHarshmage in forum General Support
Replies: 1
Last Post: 05-06-2003, 08:28 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Oracle 7085209 LSI MegaRAID SAS 9361-8i 1GB Cache 12Gbps SAS/SATA PCIe RAID Card
$28.20
LSI 9207-8i 8-Port SAS Non-RAID 6GBPS PCIe Host Bus Adapter
$34.95
Broadcom LSI 9400-16i Raid card SAS/SATA/NVME SFF-8643 SAS3416 PCIe 3.1 x8 HBA
$154.96
Cisco UCS LSI MegaRAID 9271CV-8I SAS2308 PCIe SAS Internal RAID Controller
$28.00
Inspur LSI 9300-8i Raid Card 12Gbps HBA HDD Controller High Profile IT MODE
$15.98
LSI MegaRAID 9361-8i 12Gb PCIe 8-Port SAS/SATA RAID 1Gb w/BBU/CacheVault/License
$39.95
LSI MegaRAID 9361-8i 12Gbps PCIe 3 x8 SATA SAS 3 8 Port RAID + BBU & CacheVault
$39.00
ORICO Multi Bay RAID Hard Drive Enclosure USB 3.0/ Type-C For 2.5/3.5'' HDD SSDs
$82.49
ACASIS 2.5/3.5 inch 2 Bay SATA USB 3.0 Hard Drive Disk HDD SSD Enclosure 4 RAID
$58.99
NEW LSI MEGARAID SAS 9361-8i 12GB/s SAS + SATA RAID CONTROLLER CARD PCIe x8 3.0
$99.00