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

how to set time?

Discussion in 'General' started by hirohitosan, Jan 21, 2009.

  1. hirohitosan

    hirohitosan New Member

    Messages:
    279
    Thanks Received:
    0
    Sorry for this question, but how to set hour in FreBSD. I set the time zone at installation but after starting X I realize that my clock is not set.

    there is a tool for setting time?

    tahnks
     
  2. kamikaze

    kamikaze New Member

    Messages:
    366
    Thanks Received:
    65
    You can set the time with the date(1) command.

    You can also run ntpd to automatically sync your time with a time server.
     
  3. sniper007

    sniper007 New Member

    Messages:
    110
    Thanks Received:
    2
  4. hirohitosan

    hirohitosan New Member

    Messages:
    279
    Thanks Received:
    0
    Thanks guys
    I add in /etc/rc.conf
    Code:
    ntpdate_enable="YES"

    and create the file /etc/ntp.conf
    and add
    Code:
    server 0.pool.ntp.org
    server 1.pool.ntp.org
    server 2.pool.ntp.org
    server pool.ntp.org
    driftfile /var/db/ntp.drift
     
  5. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,723
    Thanks Received:
    2,137
    I'd advise using openntpd (from ports), which will not open a listener on port 123 (which only ntp servers need) unless you tell it to.
     
    beamar thanks for this.
  6. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,521
    Thanks Received:
    2,351
    I also advise, if possible, to use the ISP's ntp server.
     
  7. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,723
    Thanks Received:
    2,137
    Sure. I lack enthusiasm for the pool.ntp.org servers. I've seen weird (big) time shifts (and associated alerts from panicking applications) when using those. They're not exactly 'professional' time servers, and they vary wildly in stratum quality.
     
  8. sniper007

    sniper007 New Member

    Messages:
    110
    Thanks Received:
    2
    I had problems with openntpd and Freebsd 7.1. With Freebsd 6.4 works fine.
     
  9. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,723
    Thanks Received:
    2,137
    Running openntpd on 7.1-STABLE (Jan 6 & Jan 8 builds) without a hitch. Haven't recompiled recently; the binary is dated March 4.
     
  10. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,521
    Thanks Received:
    2,351
    Do note that ntpdate will only set/correct the time when the system is booted.
    If you want to keep the time correct continuously try ntpd (base) or openntpd (port).
     
  11. hirohitosan

    hirohitosan New Member

    Messages:
    279
    Thanks Received:
    0
    Thanks again.
    I installed openntpd (from ports), and add in rc.conf
    ntpd_enable="YES"
    and crate /etc/ntpd.conf, add time server, reboot (I couldn't find a more elegant way) and seems to work well.
     
  12. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,723
    Thanks Received:
    2,137
    You'll need openntpd_enable="YES" .. and openntpd's config is in /usr/local/etc/ntpd.conf !
     
  13. nilsson

    nilsson New Member

    Messages:
    4
    Thanks Received:
    0
    I've been running ntpdate in cron and it seems to do the job. Am I missing something?
     
  14. sniper007

    sniper007 New Member

    Messages:
    110
    Thanks Received:
    2
    Why you don't read handbook ? It's FREE :e