[mythtv-users] ensuring mythbackend will be idle for db optimize

Philip Brady phil.brady at hotmail.co.uk
Tue Sep 22 16:10:18 UTC 2015


 
> From: jerome at supernet.ab.ca
> To: stephen at jsw.gen.nz; mythtv-users at mythtv.org
> Date: Tue, 22 Sep 2015 10:00:36 -0600
> Subject: Re: [mythtv-users] ensuring mythbackend will be idle for db optimize
> 
> On Tuesday, September 22, 2015 07:52:35 PM Stephen Worthington wrote:
> > On Mon, 21 Sep 2015 12:48:42 -0600, you wrote:
> >
> > ...
> > avoid times when recording is happening.  I already have a crude way
> > of doing this in my balance_storage.sh script, by parsing the output
> > of the mythtv-status command, so that balance_storage.sh will stop if
> > the next recording is within 5 minutes (or if there is a recording in
> > progress).  Feel free to borrow any code you like from it:
> > 
> >   http://www.jsw.gen.nz/mythtv/balance_storage.sh
> > 
> > So I could just do the same, and have the optimise script wait 15
> > minutes whenever it sees a recording running or scheduled in less than
> > 15 minutes.  That should work, but there is likely now a much better
> > way of getting the time of the next recording directly from
> > mythbackend using the Services API or Python bindings.  When I find
> > the time, I intend to start learning about the Services API, which
> > seems to be where the new work is going now.
> 
> There's a super-easy example at https://www.mythtv.org/wiki/Upcoming_Parse.pl that I have modified to just pick the first upcoming recording and compare its timestamp to now. The API requires XML parsing but there are plenty of ways to do that.
> 
> Or, yet another way.  Since you are using mythwelcome and presumably ACPI for wakeup, you will have a routine which sets the wakup time - suggested name in the wiki is /usr/bin/setwakeup.sh.  Planting your code there will also work.  That's where I plant database backups, optimizes and copying of recordings and everything waits nicely until they are finished.    See autobackup.sh in the wiki for the approach. Phil Brady
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20150922/a8b1bcf1/attachment.html>


More information about the mythtv-users mailing list