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

Peter Bennett (cats22) cats22 at comcast.net
Mon Sep 21 20:39:17 UTC 2015


On 09/21/2015 02:48 PM, Jerome Yuzyk wrote:
> I've used optimize_mythdb.pl regularly for a long time without much regard for the database being busy, because it never did more than check the DB and fortunately never found anything to repair, so it was pretty much a read-only operation.
>
> But the latest version in 0.27.5 will defragment seektables and that means writing the DB for sure.
>
> How will this behave while recordings are being made, processed, or watched?
>
> Will MySQL just handle the table-locking automagically? I suspect not.
>
> So, I think I need to find or write something that asks if the front- and backend is or will be quiet for the next N minutes, before optimizing. 
>
> Has anyone done this already? Creative uses of MythWelcome?
>
My solution to this -
I always run this from the script that is called from "Pre Shutdown
check-command" (mythtv-setup, General, Shutdown/Wakeup Options). At this
point mythtv is ready to shut down, so nothing is recording in the near
future. My script also checks the date and makes sure the DB reorg is
only run once a week, since that script is called every time you shut down.

Peter

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20150921/4509be16/attachment.html>


More information about the mythtv-users mailing list