User Manual:Periodic Maintenance

From MythTV Official Wiki
Revision as of 16:47, 16 January 2006 by

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Maintaining your MythTV

Your MythTV system can continue to run for weeks, months or even years. Of course, this is unlikely for several reasons. First of all, you can't keep your hands of! Yes, you're a techie and you like to fiddle. Second, hardware can and will fail eventually. Third, power-outages, tornados, alien takeovers and other unfriendly environmental disasters happen. But, if you are interested in keeping your MythTV alive for as long as possible, here's a few suggestions.


Your system is only as good as your backup. What? No Backup? You can't be serious... Well, now is the time to start backing it up. Why? Although you had fun building it and are confident you can rebuild quickly so you don't miss your favorite shows, there are two parts of MythTV that aren't easily replaceable: the database, and your media content (TV recordings, videos, photos, music, etc.)

The database

The database stores a whole lot of stuff you will only miss when it's gone. For example, it keeps a history of every show you've recorded, which is very nice when you don't want to re-record the same show over again. It keeps all the settings of your backends and frontends, it keeps metadata of all your videos (titles, director, parental levels, etc), it keeps all the commercial flaggings, and more.

Probably the easiest way to backup the database is to create a cron job that will dump the data out to a file. Here's a sample script that I put in /etc/cron.daily/

#Dumps the mythconverg database - daily backup
#Keeps the last 7 days
DAY=($(date +%u))
mysqldump -u mythtv -pmythtv mythconverg -c > /mnt/foo/sqldump/$DUMPFILE
exit 0

This will keep a rotationg backup of the last 7 days. Notice that the dump location is on a remote server, for added protection.

The media

TODO: media backup

OS and software maintenance

I'll start by saying: If it ain't broke, don't fix it! This is more difficult to follow if your MythTV servers other purposes besides Myth. I might add that if you have non-technical people using Myth for their daily TV watching, they will appreciate you keeping your hands. If you must mess, please be sure to backup before you do. Expect that fixing one thing will break another.