sidux.com
Menu

News

Give back
Last 3 Contributions
30-11-2008 20.00
25-11-2008 100.00
25-11-2008 20.00

Donate


Sponsor
hetzner.de

Languages
Preferred language:



Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
op4latino
Post subject: Sync system's time  PostPosted: May 17, 2008 - 01:41 PM



Joined: Dec 02, 2006
Posts: 1045
Location: East Coast
Status: Offline
I've been using fix-time to sync my computers' time, but I was getting tired of pressing ENTER twice when dpkg-reconfigure tzdata asks me what time zone I wanted. I've cut some stuff from sidux's fix-time script

Code:
#!/bin/bash
# Updates the system's clock once the time zone has been set previously

# Servers can be found at:
#       http://www.pool.ntp.org/zone/@

NTPSERVER="0.us.pool.ntp.org 1.us.pool.ntp.org 2.us.pool.ntp.org 3.us.pool.ntp.org"

# sync with time servers
for i in $NTPSERVER; do
        if ntpdate -u -b "$i"; then
                        hwclock --systohc
                        break
        fi
done
 
 View user's profile Send private message  
Reply with quote Back to top
slh
Post subject: RE: Sync system  PostPosted: May 17, 2008 - 01:47 PM



Joined: Nov 25, 2006
Posts: 2570

Status: Offline
Why?

ntpdate is called by ifup.d --> for those who shut down their systems at night once a day (at each reboot, when the network interface goes up).

Only servers (:= as system running around the clock with months of uptime) would need regular ntp syncs, what about adding a call to /usr/sbin/ntpdate-debian to cron.daily?
 
 View user's profile Send private message  
Reply with quote Back to top
op4latino
Post subject: RE: Sync system  PostPosted: May 17, 2008 - 01:57 PM



Joined: Dec 02, 2006
Posts: 1045
Location: East Coast
Status: Offline
You've nailed one more time. Yes, the script is needed for a server. I'll add ntpdate-debian to cron.daily

Thank you
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
 
Logos and trademarks are the property of their respective owners, comments are property of their posters, the rest is © 2006-2008 by sidux e.V., 10407 Berlin, Kniprodestr. 104. sidux e.V. is a Berlin, Germany based non-profit foundation. Consult Impressum and Legal Terms for details. sidux™ is Free Software released under the GNU/GPL license and other compatible licenses.
powered by Zikula & Zafenio