[mythtv-users] mysqlrepair all tables on startup

Ian Clark mrrooster at gmail.com
Wed Jan 27 14:10:04 UTC 2010


2010/1/26 Glenn B. Lawler <gblawler at incodesystems.com>

> I would like to run a script with:
>
> mysqlrepair mythconverg {tablename}
>
> for each table on startup.
>
> I am running MythTV 0.21 under gentoo.
>
> Could someone send me information about how to include such a script in the
> startup procedure?
>
> I run a rotating backup and database check on shutdown, figured this was
better as usually I don't care if it takes a little while to shutdown, but I
do want it to boot promptly.

I recently added the rotating backup (using the script supplied with myth
that I forget the name of off the top of my head) after a recent crash wiped
out my programs table. (that was a fun few hours of fixing. :) )

The relevant sections from my /etc/init.d/mythtv script (run on shutdown):-

        log_action_msg "Killing mythbackend"
        pkill mythbackend
        log_action_msg "Checking and repairing database"
        mysqlcheck -r -umythtv -pmythtv mythconverg 2>&1 >/dev/null
        log_action_msg "Optimizing database"
        mysqlcheck -o -umythtv -pmythtv mythconverg 2>&1 >/dev/null
        log_action_msg "Backing up myth database"
        /usr/local/mythtv/share/mythtv/mythconverg_backup.pl/home/mythtv/.mythtv/backuprc


NB: My myth is installed in a non standard prefix, so the
mythconver_backup.pl script may not be where I say it is. :), it's prob in
/usr/local/share/mythtv

NB2: My pvr is behind a firewall, so I'm not worried about having connection
passwords in scripts, if you are, this may not be a viable solution for you.

Cheers,

Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20100127/57bf099a/attachment.htm>


More information about the mythtv-users mailing list