[mythtv-users] Any way to run a user job/script when recording starts?

Jarod Wilson jarod at wilsonet.com
Fri Nov 13 05:46:36 UTC 2009

On 11/13/2009 12:27 AM, Raymond Wagner wrote:
> On 11/12/2009 23:38, genestapp at charter.net wrote:
>> I'm wanting to know if there is a way to automatically run a
>> script/user job when a program begins recording. I'm only wanting to
>> use it on a single instance of a sports series recording. I know i
>> could set it up as a user job to run after but I'm need it to run
>> realtime and begin when recording starts
>> Any ideas?
> There is currently no real good way of doing this.
> You can enable real-time commflagging, and wrap mythcommflag with your
> own script that runs whatever tasks you want. But this is an ugly hack,
> and the jobqueue makes no effort to run things in any sort of scheduled
> manner. It runs once per minute FIFO, and tasks are run when they're
> gotten to.
> You can create a channel change script, which runs your own tasks on
> start. But this is an even uglier hack, and only works on analog anyway.
> One of the users on IRC wrote some code to do pre- and post-roll during
> playback to manage some networked lighting units, but that is on
> playback, not recording.

How 'bout http://swatch.sourceforge.net/ or similar, pointing at your 
backend log, where the start of a recording is logged?

Example from /var/log/mythtv/mythbackend.log here:
2009-11-12 20:59:03.433 Started recording: CSI: Crime Scene 
Investigation "The Lost Girls": channel 6041 on cardid 5, sourceid 6

(But sure, some triggers similar to post-recording jobs would be neat, 
patches welcome, as they say... ;)

Jarod Wilson
jarod at wilsonet.com

More information about the mythtv-users mailing list