1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Setting/changing the system time in bash (fedora 3)

Discussion in 'Linux / Unix Discussion' started by Pete01, Aug 9, 2007.

  1. Pete01

    Pete01 Kilobyte Poster

    492
    23
    42
    Anyone know how to change the system time on a Fedora 3 box using a bash shell? the version of bash is:

    GNU bash, version 3.00.14(1)-release (i386-redhat-linux-gnu)

    I'm connecting using WinSCP and have lost my VNC connection, can't reboot the machine any time soon so that's not an option.
     
    Certifications: MCP (NT4) CCNA
    WIP: 70-669, Learning MSI packaging
  2. Pete01

    Pete01 Kilobyte Poster

    492
    23
    42
    Found this:

    http://www.ee.udel.edu/~mills/ntp/html/ntpd.html
     
    Certifications: MCP (NT4) CCNA
    WIP: 70-669, Learning MSI packaging
  3. Pete01

    Pete01 Kilobyte Poster

    492
    23
    42
    Another update -

    There's a file - etc/ntp/ntpservers that I can modify and put in the address of the time server I want to use.
     
    Certifications: MCP (NT4) CCNA
    WIP: 70-669, Learning MSI packaging
  4. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    6,623
    115
    224
    You can *set* the time with the date command. On some platforms you can also cause the time to drift with the date command. This is useful if you don't want discontinuities in logging and similar apps.

    Depending on your versions, ntpd will work fine as long as 1) You use a good ntp server not too far away, and 2) the current date and time on the box aren't too far out.

    Traditionaly on boot ntpdate was run first to get the clock close enough for ntpd to work. Whether this is required for your box will be shown in the man page for ntpd.

    Harry.
     
    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+

Share This Page

Loading...