[mythtv-users] Auto-shutdown and EPG data

Timo Boettcher spida at gmx.net
Sat Mar 27 09:44:36 EST 2004


Hi Henk,


* Henk Poley <hpoley at dds.nl>, Saturday, March 27, 2004, 2:55:22 PM:

> I've ran MythTV with automatic shutdown (after all frontends are
> disconnected and nothing is recording) for some time noe. But I
> always updated the EPG by hand. Setting a cron job wouldn't really
> help since you don't know is the machine will be on by then. Now I
> figured that others will have the same problem, so have have you
> solved it?

IIRC Redhat had a special crondaemon named anacron (asyncronous cron)
which was able to find out when a cron-job was last executed and would
then execute it again if it was overdue. It looks like the
vcron/vixie-cron (as installed by gentoo) can do it as well, but I
didn't try.
OTOH, you can write a small script that does something like that:

====================================================================
if datediff(getdate(getfirstline(/var/log/lastrunof.cronjob)), now) \
   > 1 day then
   run cronjob
   echo now > /var/log/lastrunof.cronjob
end if
====================================================================

and execute it every 5 minutes. Thats just a bit of pseudocode, I don't
know if you can do that with shell-scripts (especially the datediff
thing) but perl would do that.

 Timo



More information about the mythtv-users mailing list