<!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">
<blockquote type="cite"><font color="black"
 face="Verdana,Arial,Helvetica" size="2"><font color="black"
 face="Verdana,Arial,Helvetica" size="2"><font color="#660066">So, my
question is this: is there a way to "test" Mythtv from <br>
&gt; a cron job to determine if there are active recordings in process?
I <br>
&gt; thought I might be able to query the database? But, in looking at <br>
&gt; mythtv's tables, it is not obvious to me what table/field I would <br>
&gt; issue the test against? Or, maybe there is already a "hook"
built-in <br>
&gt; to mythtv that I could use? Any suggestions are welcome. Thanks. <br>
&gt; </font></font></font></blockquote>
You can use mythshutdown which will return a status:<br>
<br>
mythshutdown --check <br>
<br>
or <br>
<br>
mythshutdown --status<br>
<br>
some options for mythshutdown are <br>
<br>
-c/--check&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (check shutdown possible returns 0 ok to shutdown<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 reset idle check)<br>
-s/--status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (returns a code indicating the current status)<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 - Idle<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 - Transcoding<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2 - Commercial Flagging<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4 - Grabbing EPG data<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8 - Not used<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16 - Locked<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 32 - Not used<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 64 - In a daily wakeup/shutdown period<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 128 - Less than 15 minutes to next wakeup period<br>
<br>
<br>
<br>
</body>
</html>