[mythtv-users] Backing up mysql database.

Marc drayson at net1plus.com
Sun Sep 9 02:55:40 UTC 2007


From: mythtv-users-bounces at mythtv.org
[mailto:mythtv-users-bounces at mythtv.org] On Behalf Of Craig Huff
Sent: Saturday, September 08, 2007 9:26 PM
To: Discussion about mythtv
Subject: Re: [mythtv-users] Backing up mysql database.

 

On 9/8/07, Marc <drayson at net1plus.com> wrote:

<snip>

 

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
_______________________________________________ 
<snip>

 

#! /bin/bash
#
# Created on 3/22/2006 by sdkovacs
# Updated on 9/8/2007 by Marc
# Script: mythbackup
#
#
#
########################################################
BACKFILE="/record/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

<snip>

 

Marc


Marc,

Looks like you smooshed two lines together.  Try inserting a linefeed
between "${BACKFILE}" and "if".

The "e" gzip is complaining about is in "-ne".  Without looking at the man
page for gzip, I'm betting that -n is a legitimate option for gzip. 

Nice to know I'm not the only one with fat fingers. ;-)

Craig.

 

 

Strange.. Those line feeds never showed up in my original message.

Thanks

Marc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20070908/e0d7e5f6/attachment.htm 


More information about the mythtv-users mailing list