[mythtv-users] Running optimize_mythdb.pl before mythfilldatabase

Yeechang Lee ylee at pobox.com
Mon Feb 19 19:22:03 UTC 2007


Nick Morrott <knowledgejunkie at gmail.com> says:
> There is an database optimisation script in /mythtv/contrib called
> optimize_mythdb.pl which many users run daily via cron.

Based on the suggestion at
<URL:http://www.gossamer-threads.com/lists/mythtv/users/252381#252381>,
I've written a shell script [1] that 1) runs the optimize_mythdb.pl
script (instead of calling it daily from cron as I previous did),
*then* 2) mythfilldatabase. I call the script, mythopfdb, in
mythfilldatabase's place in mythtv-setup.

I have no idea whether there indeed is the possibility of an undesired
race condition by having these two actions occur at the same time, but
in any case using this script also solves the question, occasionally
raised here, of whether to make running the optimize_mythdb.pl script
an automatic background task for everyone without having to manually
set up a way of doing so. mythfilldatabase may very well be the ideal
place to cause this to occur, with of course a command-line switch to
prevent the script from being run as desired.

[1] #!/bin/sh
    # mythopfdb - Call this in mythfilldatabase's place in
    # mythtv-setup

    perl /usr/share/doc/mythtv-0.20/contrib/optimize_mythdb.pl && \
    mythfilldatabase $*

-- 
Yeechang Lee <ylee at pobox.com> | +1 650 776 7763 | San Francisco CA US


More information about the mythtv-users mailing list