[mythtv-users] Disable Automatic Database Backup
Michael T. Dean
mtdean at thirdcontact.com
Wed Nov 11 20:39:04 UTC 2009
On 11/11/2009 02:25 PM, Eloy Paris wrote:
> On Tue, Nov 10, 2009 at 08:30:10PM -0500, Michael T. Dean wrote:
>> Sorry, I haven't gotten that far, yet. We need a /lot/ more
>> infrastructure to prevent automatic backups from corrupting the DB
>> or recordings. It's on my TODO--just might be below a much bigger
>> job that will actually make the auto-backups /much/ easier. :)
> Hhmmm. Dumb question: why would a backup corrupt the database or
The recordings could easily be corrupted when the system becomes I/O or
even CPU bound, depending on system resources and capture configuration.
The database corruption is mainly possible when making Myth perform
automatic maintenance--which is required to make sure the backups are
actually useful. If we tell users we do automatic backups, then when a
user needs a backup, she finds out that some of the tables were crashed
when the backup(s) was(were) created, so those tables and their data is
not in the backup, it's actually worse than telling users to maintain
and backup their databases themselves.
For both of these issues, we need an approach to make sure that Myth
isn't doing anything (recording, playing back, transcoding, commercial
flagging, ...) at the point when we do the backup. And, to make things
work properly, we really need to ensure that no one (/none/ of the
frontends/backends/other clients (like MythWeb)) is changing the data in
the database when the backup is created.
> I mean, a backup just reads data, right? Or that's not the
> case here? Is the issue that a backup cannot be made while there are
> clients (backends, frontends) connected to the database?
That could easily cause corruption of the data in the backup, itself, so
another reason we need the infrastructure discussed above.
FWIW, you should be fine creating a cron job to back up your database
daily (or whatever). Just do your best to pick a time when recordings
are least likely to occur. If you're running optimize_mythdb.pl in a
cron job, you may want to just add mythconverg_backup.pl right after
it. However, we're currently leaving it up to the user to decide
whether or not to do so.
More information about the mythtv-users