[mythtv-users] Check for active Recordings or Jobs?

Tony Lill ajlill at ajlc.waterloo.on.ca
Thu Sep 27 03:15:31 UTC 2007

James Pifer <jep at obrien-pifer.com> writes:

> I use mythrename.pl and I have it modified for my purposes. It's all
> well and good, but I'd like to run it more often. Right now I run it at
> 1AM. I'd really like to run it after each recording or maybe every hour,
> but only if no user jobs are running and no recordings are active. 
> Is there way to check for active recordings and jobs?
> Is there a way to run mythrename.pl as a global post recording job?
> (honestly I have not looked through the menus for this)
> Other suggestions?

Well, if you connect to port 6544 on the backend you can grep throught
the xml it sends you:

/bin/echo -e -n "GET / HTTP 1.0\r\nHost:\r\n\r\n" | \
nc -w 5 localhost 6544 | \
grep "Encoder .* is local on .* and is recording"

Of course, there is a bug that sometimes makes the backend crash. 

It will also tell you what's in the job queue.

You can also connect to the database directly and look through the
jobqueue table. A status of 272 means the job is done, as is the
recording's abscence from the table. There's probably some way of
checking if the job is recording though the database too, but you can
just check the modify time on the file. Active recordings should be no
more that a few seconds old.
Tony Lill,                         Tony.Lill at AJLC.Waterloo.ON.CA
President, A. J. Lill Consultants        fax/data (519) 650 3571
539 Grand Valley Dr., Cambridge, Ont. N3H 2S2     (519) 241 2461
--------------- http://www.ajlc.waterloo.on.ca/ ----------------

Understatement of the century:
"Hello everybody out there using minix - I'm doing a (free) operating
 system (just a hobby, won't be big and professional like gnu) for
 386(486) AT clones"

	- Linus Torvalds, August 1991

More information about the mythtv-users mailing list