[mythtv-users] Backing up mysql database.

Marc drayson at net1plus.com
Sat Sep 8 23:11:27 UTC 2007


-----Original Message-----
From: mythtv-users-bounces at mythtv.org
[mailto:mythtv-users-bounces at mythtv.org] On Behalf Of sdkovacs
Sent: Wednesday, September 05, 2007 12:02 PM
To: Discussion about mythtv
Subject: Re: [mythtv-users] Backing up mysql database.

On 9/5/07, clemens at dwf.com <clemens at dwf.com> wrote:
> Is there any advantage in using one of the mysql backup programs over
> just taring up /var/lib/mysql/mysql and /var/lib/mysql/mythconverg ?

The advantages have already been mentioned in this thread, and in case
others are interested, here is a short script i run daily in cron to
backup the mythconverg database. It automatically overwrites the
backup from the previous week so you always will have 7 days of
backups. Additionally, the cp statement at the end of the script
copies the db dump to another physical disk in case of a root disk
crash.
Edit the script as needed.

#! /bin/bash
#
# Created on 3/22/2006 by sdkovacs
# Script: mythbackup
#
#
#
#
########################################################
BACKFILE="/home/mythtv/mythbackup.`date +%a`.sql.gz"


mysqldump -u mythtv -pmythtv mythconverg -c | gzip -c > ${BACKFILE}
if [ $? -ne "0" ]
then
        echo "Mythtv database backup failed! Exiting..."
        exit 1
fi

cp ${BACKFILE} /videos/backup/myth
_______________________________________________
mythtv-users mailing list
mythtv-users at mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


Thanks. This is great. I have modified it to backup directly to my media
drive which is a raid 5 array without needing to cp to another drive.
Theoretically, I should never need it considering both my frontend and
backend mirrored OS drives. But it's better to have it then not.

Marc




More information about the mythtv-users mailing list