View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 5 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Wed Apr 14, 2004 12:06 pm 
Offline
Joined: Fri Apr 02, 2004 10:08 am
Posts: 1637
Location: Virginia, USA
A few questions on the correct and/or best way of periodically updating my system's clock to be the correct time (and thereby getting recordings to start and stop at the correct times).

* First, is there anything already in place to do this?

* Second, thinking that maybe there isn't, I put the following line at the end of /etc/crontab

Code:
# synchronize time on every 5AM daily with time server
00 5     * * *    root     ntpdate time-a.nist.gov


Is this OK to do?

* Third, assuming the above is correct, how can I tell if it's working? I checked /var/log/messages but did not see anything that seems to indicate it did. If a lack of messages does indeed indicate that, then...

* I think I read in a forum search here that cron might have to be restarted in order to get changes to /etc/crontab to be recognized. What I didn't see is how best to restart cron.

As always, thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 14, 2004 12:24 pm 
Offline
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location: Nashville, TN
to restart cron do /etc/init.d/cron restart

ntp is installed, but not activated, from what cesman has said, however it was activated on my machine, and I had to turn it off, because the networks around here don't run on the official time obviously, and my recordings were off.


Top
 Profile  
 
 Post subject: syslog.0
PostPosted: Wed Apr 14, 2004 4:01 pm 
Offline
Joined: Fri Mar 26, 2004 6:12 pm
Posts: 57
Location: Chicago
if I grep syslog.0 it shows that it's being run but doesn't show what the offset is. Kind of peculir, as it shows this ini openbsd.

Rob


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 1:04 am 
Offline
Joined: Tue Feb 03, 2004 3:23 am
Posts: 159
Location: Friesland, The Netherlands
I think the command you want to run is:

ntpdate -u time-a.nist.gov

The -u flag tells ntpdate to check for the date on the remote host and update accordingly. You can also use the -q flag to just query for the time on the remote host.
A better solution would be editing the /etc/ntp.conf and use the daemon to constantly monitor the time and update the time accordingly. Here's an example ntp.conf which has entries for five public timeservers in Europe:



Code:
# /etc/ntp.conf, configuration for ntpd

# ntpd will use syslog() if logfile is not defined
#logfile /var/log/ntpd

driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

### lines starting 'server' are auto generated,
### use dpkg-reconfigure to modify those lines.

server  tick.keso.fi            # Public NTP server in Pieksamaki, Finland
server  ntp3.theinternetone.net # Public NTP server in Amsterdam, The Netherlands
server  ntp.univ-lyon1.fr       # Public NTP server in Lyon, France
server  time.kfki.hu            # Public NTP server in Budapest, Hungary
server  ntp.cis.strath.ac.uk    # Public NTP server in Glasgow, Scotland





You can try this configuration, run /etc/init.d/ntp start and check whether it's working by using:

ntpq -p

It may need a couple of minutes after the ntp daemon is started before showing proper output, but it will list the servers it's using and strata. More info on it's output in man ntpq. This post also has extra information:
http://mysettopbox.tv/phpBB2/viewtopic.php?t=857


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 7:03 am 
Offline
Joined: Fri Sep 19, 2003 7:05 pm
Posts: 5088
Location: Fontana, Ca
One should note that syncing your time w/ NTP doesn't gaurantee that you recordings will start on time. Networks seem to have thier own definiton of time. After changing your time it is a good idea to restart mythtv-backend.

_________________
cesman

When the source is open, the possibilities are endless!


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu