10

Apparently there is no gui in XFCE (as there was in gnome) to synchronize time with NTP (if there is one, please let me know the name of the application). So, how can I synch with the time servers?

(I'm using Debian wheezy)

2
  • Look into your distro's docs, it's usually a single configuration file edit and possibly activating a service.
    – Mat
    Feb 17, 2012 at 6:15
  • 1
    try using command ntpdate <your country code>.pool.ntp.org and if you want it to be updated as soon as your computer starts add it to the deamon list. see <your country code> at www.pool.ntp.org Feb 17, 2012 at 8:09

4 Answers 4

7

On Debian you can either install the ntp package, which will run a daemon that automatically keeps your clock synced, or the ntpdate package which provides a command to run manually to sync the clock.

Personally I run the ntp daemon so I never have to worry about it. Simply installing the package should be enough to get it started and syncing your clock automatically.

3
  • i've installed ntp package, so i guess the daemon runs automatically? 'cos i cannot see it in the process list.
    – sterz
    Feb 17, 2012 at 8:32
  • 1
    @sterz the daemon is called ntpd and it should be run automatically and show up in the process list. Feb 17, 2012 at 18:19
  • yes indeed it is running, saw it when i ran ps -A. gnome system monitor didn't show it...weird.
    – sterz
    Feb 17, 2012 at 19:08
2

If you don't want to install the daemon you can install the client instead (package ntpdate) and put something like this in an executable file in /etc/cron.weekly/:

#!/bin/sh
#
# sync system clock

set -e

COMMAND="/usr/sbin/ntpdate-debian"

if [ -x "$COMMAND" ]; then
    "$COMMAND"
else
    echo "`basename $COMMAND` not found"
    exit 1
fi

It'll update the clock on a weekly basis. Also, I'd recommend installing anacron if your machine is not turned on 24 hours a day.

2

Constantly running a daemon for time synchronization on a workstation feels like an overkill to me. The ntpdate package suggested by others is intended for machines with intermittent network connectivity (by default it is run whenever a network interface is brought up, which may not be desirable) according to the README.Debian. Furthermore, the same readme recommends a more light-weight alternative - rdate. Having installed it all you need for daily time synchronization is

$ cat /etc/cron.daily/ntp-time-sync 
#!/bin/sh

rdate -an pool.ntp.org | logger -t "NTP(rdate)"

The -a instructs rdate to use adjtime(2) to gradually adjust the system clock. Skip it if that's not important or the machine is often turned on for short periods of time. Piping through logger is also optional, but useful to verify the sync works and for occasionally checking the clock skew.

0

I had the same issue after installing Sparkylinux(xfce) 3.6 Although I had my timezone and local time setup accurately, the clock showed four hours ahead.

I installed two packages and the time synced up right away. The packages that installed are: ntp and ntpdate.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .