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)
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityOn 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.
ntp
package, so i guess the daemon runs automatically? 'cos i cannot see it in the process list.
ps -A
. gnome system monitor didn't show it...weird.
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.
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.
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.
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> atwww.pool.ntp.org