LinHES Forums http://forums.linhes.org/ |
|
Updating MythTV box's clock via ntpdate and crontab http://forums.linhes.org/viewtopic.php?f=6&t=1201 |
Page 1 of 1 |
Author: | ceenvee703 [ Wed Apr 14, 2004 12:06 pm ] |
Post subject: | Updating MythTV box's clock via ntpdate and crontab |
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. |
Author: | Xsecrets [ Wed Apr 14, 2004 12:24 pm ] |
Post subject: | |
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. |
Author: | Robstarusa [ Wed Apr 14, 2004 4:01 pm ] |
Post subject: | syslog.0 |
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 |
Author: | willem [ Thu Apr 15, 2004 1:04 am ] |
Post subject: | |
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 |
Author: | cesman [ Thu Apr 15, 2004 7:03 am ] |
Post subject: | |
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. |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |