<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<pre wrap="">
> Date: Sat, 2 Dec 2006 02:37:06 -0500
> From: Chris Pinkham <a class="moz-txt-link-rfc2396E"
href="mailto:cpinkham@bc2va.org"><cpinkham@bc2va.org></a>
> > With your inuseprograms table and knowledge of which disks and
> > encoders are in use, would it be possible to do these tasks
> > when the system is quiet?
> I believe so. The housekeeper could do something like this:
> void HouseKeeper::RunHouseKeeping(void)
> {
> ...
> if ((wantToRun("DailyDBTasks", 1, 0, 24)) &&
> (SystemIs<span id="mail-highlight-id"
style="background-color: yellow;">Idle</span>()))
> {
> RunExternalDailyDBTasksScript();
> updateLastrun("DailyDBTasks");
> }
> ...
> }
> That way the backup/optimize never actually runs until the system is <span
id="mail-highlight-id" style="background-color: yellow;">idle</span>.
> With this, it may make sense to include a script that does do the check,
> optimize, and backup. The name could be a setting if the user chose to
> use their own, but otherwise we'd use the stock one. Could probably take
> advantage of or extend the perl bindings some for this.
> Anything that is recording or in use by some form of playback should be in
> the inuseprograms table. The only notable exceptions that I know of
> for this are MythArchive and nuvexport when it's not using mythtranscode.
> That makes it easy to check whether we're <span
id="mail-highlight-id" style="background-color: yellow;">idle</span> or not. That covers
> the MythTV portion. We know nothing about plugins, but we probably don't
> care either.
>Does this also manage to avoid system-about-to-become-non<span
id="mail-highlight-id" style="background-color: yellow;">idle</span>?
>E.g., you want to make sure the optimize/backup doesn't -start-
>within some configurable time (on the order of a couple of minutes)
>of when any encoder is -going- to be busy. This requires at least
>some interaction with the scheduler, but no more than MythWeb's
>"Status" page has.
I'm not sure what you guys are talking about and how this relates to LiveTV channel switching, However I like the idea of scheduled MYSQL backups and other daily jobs that won't interfere with upcoming recordings. I think this could be started by Mythwelcome. When the system is idle, and there are no recordings about to start (in a configurable period of time) Mythwelcome will set the next time to wake up and then run the shutdown command. In addition, perhaps it could kick off a daily job if there is one, and wait again for the idle time.
The Mythwelcome doc is on the wiki:
        <a class="moz-txt-link-freetext" href="http://www.mythtv.org/wiki/index.php/Mythwelcome">http://www.mythtv.org/wiki/index.php/Mythwelcome</a>
Mythwelcome will also prevent the backend from shutting down the system if it is busy commercial flagging, downloading EPG data, transcoding or shutdown has been locked by a user.
</pre>
</body>
</html>