[mythtv] [mythtv-users] WOL Slave Backend only when needed

Ma Begaj derliebegott at gmail.com
Wed Dec 19 08:23:49 UTC 2007


2007/12/19, Mitch Gore <mitchell.gore at gmail.com>:
> > 1.  when there are commercial flagging jobs.  I want the slave to do all
>
> >
> > > flagging.  When my combined FE/BE is flagging i get pre-buffers when
> > > watching HD so i would prefer it not to ever do it.
> >
> > Nice idea, I like it.
> >
> > Make your own script (bash or perl) which runs mythcommflagging. It
> > could work like this:
> > 1. check whether slave is online (with ping or something else)
> > 2. if not, run WOL command to wake slave and wait 1-2 minutes to finish
> booting
> > 3. run mythcommflag  (for the slave)
> >
>
>
> So here is what I was thinking...
>
> I need to parse the xml file that is on ip_of_master:3644/xml
> then parse that to leave me with whats in between <JobQueue> and </JobQueue>
> Inside that it appears jobs are listed.  There is a field that lists Status.
>  When this equals 1 a job is in queue. So i need to power on the FE(if its
> not already running), ssh to it, and run the mythjobqueue.
>
> Then, my though was to have the master check the status of the job queue
> every 30 mins.  If there is any pending or in-progress jobs do nothing.  If
> all jobs are status=272 (this means completed)  ssh to the FE and power it
> off.  I think 30mins would be a good timing to not be powering off the
> backend all the time, maybe i should make it longer Thoughts?
>
>
> Anyone be willing to work on a script?  I am not very inclined on scripting
> yet.
>
> also CCing the Dev list.  Devs,  maybe a script isnt the best idea.  Would
> doing this in the backend be easier/better?

JobQueue parsing could be done in perl with something like this,
without using some additional perl packages:

--------------
my $jobqueue;
my $xml = `wget -c -q -O - http://ip_of_master:3644/xml`
if ($xml =~


More information about the mythtv-dev mailing list