[mythtv-users] Disable Automatic Database Backup

Michael T. Dean mtdean at thirdcontact.com
Sat Nov 14 18:39:42 UTC 2009

On 11/14/2009 12:32 PM, Mark Garland wrote:
> Thanks for your replies on this.  I am still finding these scripts a little
> confusing, so just wanted to clarify a few quick points.  
> My distro (Kubuntu) has a script in cron.weekly by Paul Andreassen, although
> by default it's backing up to a location on the same disk which could limit
> the usefulness of the backup (although, I can easily change this).  
> However, I am still confused as to mythfilldatabase.pl.
> - should I be running it?  I think so.  I'm sure I read somewhere that it
> should be daily.
> - and when should I run it, linked to optimize_mythdb.pl (i.e. should it be
> done before or after?).  I'm guessing before - so that the database can be
> filled, then optimized, then backed up.
> My current thinking: (the box is unlikely to be used between 1am and 6am)
> - I'll leave the "Disable Automatic Database Backup" setting unchecked
> although I now understand that it doesn't do quite what I thought.

I'd recommend enabling this.  It will only stop any backups from being
made when the DB schema version changes.  No other automatic backups are
ever made by Myth, so leaving it enabled and staying on 0.22-fixes, it
will do absolutely nothing.  But when you upgrade to 0.23 (when
released), it will remember to back up your database--even if you forgot
to.  :)

> - I'll disable the distro provided backup script.

You can use either of the backup scripts you want--or both for that
matter.  Pick the one you're most comfortable using or that provides the
features you want.

> - I'll set mythfilldatabase to be run at, say 1am-2am, through the mythtv
> settings menu.

Especially if you live in an area where the listings provider suggests a
time to run mythfilldatabase, it's /much/ better to let mythbackend run
mythfilldatabase at the time specified by your provider.  As for the
backup, there's really no reason that the backup needs to have the
most-current listings--if you ever have to restore the DB, you can
always run mythfilldatabase manually to update listings.

> - I'll write a script of my own, to be run daily, *after 2am* that will call
> optimize_mythdb.pl, then right after will use the scripts that Mike has
> suggested (http://www.mythtv.org/wiki/Database_Backup_and_Restore).  

This isn't a bad idea.  I'd just leave mythfilldatabase separate from
the optimize and backup.

If there's a reason you need to ensure mythfilldatabase runs at a time
when the system isn't busy and you're using Schedules Direct, check out
David Yoder's script(s) in the thread at
http://www.gossamer-threads.com/lists/mythtv/users/404173#404173 .  It
allows you to have mythbackend call mythfilldatabase at the time
suggested by the listings provider to download the listings data.  Then,
at the time of your choosing, you run a cron job which actually runs
mythfilldatabase using the already-downloaded files to populate your
database listings.

> - I'll set my jobqueue to run 4-6am, ensuring that the backup will be done
> long before any jobs start.  If I do it the other way around, and have a
> long running job, it could catch out the backup.

Also a good plan.


More information about the mythtv-users mailing list