Setting Time/Date in linux??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skyy
    New Member
    • May 2007
    • 109

    #1

    Setting Time/Date in linux??

    Hi..

    I am working on Arm-linux os on developement board. The OS reset the time and date whenever the board is reset. Is there any way that i can run a script to set the time/date instead of manually setting it?

    Thanks..
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Originally posted by skyy
    Hi..

    I am working on Arm-linux os on developement board. The OS reset the time and date whenever the board is reset. Is there any way that i can run a script to set the time/date instead of manually setting it?

    Thanks..
    Provided the board has network access, you may want to get NTP set up and running. Otherwise you will need to keep power to the device even when it is off.

    Comment

    • skyy
      New Member
      • May 2007
      • 109

      #3
      Originally posted by Motoma
      Provided the board has network access, you may want to get NTP set up and running. Otherwise you will need to keep power to the device even when it is off.
      Yup.. so how do i get that running? thanks...

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        Originally posted by skyy
        Yup.. so how do i get that running? thanks...
        I proposed two solutions, which one are you trying to figure out?

        Comment

        • shahjapan
          New Member
          • Apr 2007
          • 63

          #5
          Originally posted by Motoma
          I proposed two solutions, which one are you trying to figure out?
          The OS reset the time and date whenever the board is reset
          means that your battery on the M/B is out of date, instead of finding other solutions you should update your battery asasp

          Comment

          • shahjapan
            New Member
            • Apr 2007
            • 63

            #6
            Originally posted by shahjapan
            means that your battery on the M/B is out of date, instead of finding other solutions you should update your battery asasp

            /usr/sbin/ntpdate -v 130.133.1.10 131.188.3.220 193.67.79.202 ; /sbin/hwclock --systohc > /dev/null 2>&1

            Comment

            • skyy
              New Member
              • May 2007
              • 109

              #7
              Originally posted by shahjapan
              /usr/sbin/ntpdate -v 130.133.1.10 131.188.3.220 193.67.79.202 ; /sbin/hwclock --systohc > /dev/null 2>&1
              hi.. thanks for the reply..

              But i cant find the ntpdate function anywhere. Instead i got this "rdate" function which is part of busybox. Any idea how to use it?

              Comment

              • Motoma
                Recognized Expert Specialist
                • Jan 2007
                • 3236

                #8
                Check out the rdate man page.

                Comment

                • skyy
                  New Member
                  • May 2007
                  • 109

                  #9
                  Originally posted by Motoma

                  Hi.. thanks for the link. What should i set for the host?

                  Comment

                  • Motoma
                    Recognized Expert Specialist
                    • Jan 2007
                    • 3236

                    #10
                    Originally posted by skyy
                    Hi.. thanks for the link. What should i set for the host?
                    I think ntp.org keeps a listing of servers. You could try searching their list for one that is close to you geographically, or you could just use pool.ntp.org.

                    Comment

                    • skyy
                      New Member
                      • May 2007
                      • 109

                      #11
                      Originally posted by Motoma
                      I think ntp.org keeps a listing of servers. You could try searching their list for one that is close to you geographically, or you could just use pool.ntp.org.
                      Hi thanks for the link...

                      But when i try with pool.ntp.org, "rdate" return with an error: Host name lookup failure.

                      I tried other time server also gives me the same error.
                      Any idea?

                      Comment

                      • Motoma
                        Recognized Expert Specialist
                        • Jan 2007
                        • 3236

                        #12
                        Originally posted by skyy
                        Hi thanks for the link...

                        But when i try with pool.ntp.org, "rdate" return with an error: Host name lookup failure.

                        I tried other time server also gives me the same error.
                        Any idea?
                        Sounds like you don't have internet access. Can you ping google from the device?

                        Comment

                        • skyy
                          New Member
                          • May 2007
                          • 109

                          #13
                          Originally posted by Motoma
                          Sounds like you don't have internet access. Can you ping google from the device?
                          Hi.. yah i got problem with my internet access. I can't ping google from the device. But my device is connected to a nework router. why it is not able to access internet?

                          Comment

                          Working...