Bacula-users

Re: [Bacula-users] is 7.2 ready for prime time?

2015-10-01 10:37:05
Subject: Re: [Bacula-users] is 7.2 ready for prime time?
From: Michael Schwager <mschwager AT mochotrading DOT com>
To: Uwe Schuerkamp <uwe.schuerkamp AT nionex DOT net>, Bacula Users Mailing List <bacula-users AT lists.sourceforge DOT net>
Date: Thu, 1 Oct 2015 09:34:54 -0500
Innobackupex is excellent- we use it- but it's not as trivial as a tar copy of the mysql directory (shut the database down first). For example, you may end up using the database username/password on the command line in your scripts (which you should probably avoid). Also, according to the man page, "After  creating  a  backup,  the  data  is  not  ready to be restored." ...Ehm, in a word: YIKES! RTFM for sure! At least they tell you what you need to do, and it's not hard, but if you miss it...

Anyway, here's a bash example of how we back up our production database. Details such as defining LOG_DIR and BACKUP_DIR left as an exercise for the reader:

cleanup () {
        status=$?
        rm -f $TMPFILE
        exit $status
}

trap cleanup EXIT SIGQUIT SIGHUP SIGINT SIGTERM

TMPFILE=$(mktemp /tmp/dbbkpXXXXX)

suffix=$(date +%w)
cp /etc/my.cnf $TMPFILE
cat /var/lib/mysql/defaults.cnf >> $TMPFILE

mkdir -p $LOG_DIR $BACKUP_DIR

innobackupex --defaults-file $TMPFILE $FULL_BACKUP_DIR > $LOG_DIR/$suffix 2>&1
innobackupex --defaults-file $TMPFILE --apply-log $FULL_BACKUP_DIR >> $LOG_DIR/$suffix 2>&1




- Mike Schwager
  Linux Network Engineer, Mocho Trading LLC
  312-646-4783 Phone    312-637-0011 Cell    312-957-9804 Fax


On Mon, Sep 28, 2015 at 2:49 AM, Uwe Schuerkamp <uwe.schuerkamp AT nionex DOT net> wrote:
On Fri, Sep 25, 2015 at 09:01:29AM -0700, Stephen Thompson wrote:
>
>
>
> I run daily backups of my database and had finished my monthly full run
> for September, so I was technically covered.  However I was not looking
> forward to restoring a 900+Gb mysql database from a text dump which on
> my system would take days, if not an entire week.  The last time I had
> to restore database from backup it was 4 or so years ago and my database
> was only 300-400Gb back then.
>
> Stephen
>
>

One word: innobackupex. You'll be up running in a few minutes again as
opposed to a week when using a text file created by mysqldump (which,
much like MyISAM tables, should be taken round the back and taken out
of its misery once and for all ;))

All the best,

Uwe








------------------------------------------------------------------------------
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users


This message is for the named person(s) use only. It may contain confidential proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Mocho Trading LLC reserves the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity.
------------------------------------------------------------------------------
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
<Prev in Thread] Current Thread [Next in Thread>