Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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)

share|improve this question
    
Look into your distro's docs, it's usually a single configuration file edit and possibly activating a service. –  Mat Feb 17 '12 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 –  harish.venkat Feb 17 '12 at 8:09
add comment

3 Answers 3

up vote 3 down vote accepted

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.

share|improve this answer
    
i've installed ntp package, so i guess the daemon runs automatically? 'cos i cannot see it in the process list. –  sterz Feb 17 '12 at 8:32
1  
@sterz the daemon is called ntpd and it should be run automatically and show up in the process list. –  Arrowmaster Feb 17 '12 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 '12 at 19:08
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.