Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Updating local pc clock from a atomic clock site???

  1. #1
    Senior Member registered user
    Join Date
    Dec 2003
    Location
    Salt Lake City, UT, U.S.A.
    Posts
    1,338

    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

  2. #2
    Senior Member registered user
    Join Date
    Nov 2003
    Posts
    361
    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.

  3. #3
    Senior Member registered user
    Join Date
    Dec 2003
    Location
    Salt Lake City, UT, U.S.A.
    Posts
    1,338
    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

  4. #4
    Senior Member registered user
    Join Date
    Dec 2003
    Location
    Salt Lake City, UT, U.S.A.
    Posts
    1,338
    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

  5. #5
    Senior Member registered user
    Join Date
    Dec 2003
    Location
    Salt Lake City, UT, U.S.A.
    Posts
    1,338
    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

  6. #6
    Senior Member registered user
    Join Date
    Dec 2003
    Location
    Salt Lake City, UT, U.S.A.
    Posts
    1,338
    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

  7. #7
    Senior Member
    Join Date
    Nov 2003
    Posts
    1,323
    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

  8. #8
    Senior Member registered user
    Join Date
    Dec 2003
    Location
    Salt Lake City, UT, U.S.A.
    Posts
    1,338
    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

  9. #9
    Senior Member registered user
    Join Date
    Nov 2003
    Posts
    361
    Quote 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.

  10. #10
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041
    --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.

    Quote 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

Page 1 of 2 12 LastLast

Similar Threads

  1. clock problems with 3.4 HD install
    By riechert in forum General Support
    Replies: 0
    Last Post: 06-24-2004, 07:43 PM
  2. clock problems with 3.4 HD install
    By riechert in forum Hdd Install / Debian / Apt
    Replies: 0
    Last Post: 06-24-2004, 06:41 AM
  3. clock problems
    By evirus in forum General Support
    Replies: 7
    Last Post: 05-07-2004, 10:46 PM
  4. Knoppix 3.3-2004.02.09 and clock setting
    By lmd in forum General Support
    Replies: 0
    Last Post: 02-13-2004, 12:18 AM
  5. Clock Time
    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
  •  


Mini External OLED AMIGA Gotek Floppy Drive Emulator For Amiga 500/500+/600/1200 picture

Mini External OLED AMIGA Gotek Floppy Drive Emulator For Amiga 500/500+/600/1200

$35.99



Vintage Amiga ICD ADSpeed 14mhz 68000 accelerator with 32kb SRAM, 16kb cache picture

Vintage Amiga ICD ADSpeed 14mhz 68000 accelerator with 32kb SRAM, 16kb cache

$117.00



(Rare) Commodore Amiga 3000 w/Monitor and Keyboard picture

(Rare) Commodore Amiga 3000 w/Monitor and Keyboard

$2000.00



Commodore Amiga Unix System V Release 4, Unlimited License PC Computer Software picture

Commodore Amiga Unix System V Release 4, Unlimited License PC Computer Software

$500.00



Amiga 500 Keyboard / Tastatur (QWERTY US) from DS Retro Garage picture

Amiga 500 Keyboard / Tastatur (QWERTY US) from DS Retro Garage

$219.00



Amiga 500 Keyboard / Tastatur (QWERTY US) from DS Retro Garage picture

Amiga 500 Keyboard / Tastatur (QWERTY US) from DS Retro Garage

$249.00



PCMCIA AMIGA 1200, 600 Compact Flash CF Adapter DRIVER + 4GB STORAGE USA picture

PCMCIA AMIGA 1200, 600 Compact Flash CF Adapter DRIVER + 4GB STORAGE USA

$22.49



Amiga External Drive Adapter and LONG Cables. Works with Gotek and Amiga Drives picture

Amiga External Drive Adapter and LONG Cables. Works with Gotek and Amiga Drives

$32.00



Amiga 600 Gotek USB Floppy Drive Emulator Complete Kit with Gotek picture

Amiga 600 Gotek USB Floppy Drive Emulator Complete Kit with Gotek

$41.05



Softwood File II by Softwood - Commodore Amiga Database Software 86/87  picture

Softwood File II by Softwood - Commodore Amiga Database Software 86/87

$13.95