← Back to team overview

mylvmbackup-discuss team mailing list archive

Re: Incremental backups with mylvmbackup

 

On Tue, Dec 16, 2014 at 10:37:44AM PST, Lenz Grimmer spake thusly:
> Hi Brian,
> 
> On 16.12.2014 16:56, Brian Beaver wrote:
> 
> > Is it possible to generate incremental backups using the mylvmbackup utility? 
> > Perhaps making use of the "tar --newer" option? 

My answer to this would be no. The only way to make incremental backups of
mysql as far as I know is percona backup but that's a bit tricky and only works
if you have all innodb and no myisam or anything else.

> As an alternative, consider using one of the other available backends, e.g.
> rsync, rsnap or zbackup - they all support incremental/differential backups.

The zbackup that I'm familiar with (zbackup.org) is really more of a dedupe
tool than a backup tool. I use mylvmbackup to get a consistent copy of the data
off of the database server into a scratch area on my backup server. Then I have
a script to tar it up (but not compress) and then if it isn't the latest full
(which I keep on hand in native form for fast and easy restore) feed it into
zbackup then delete the original. And just because I'm paranoid I take an md5
of the tarfile before I feed it into zbackup and then restore the deduped file
and make sure the md5's are the same before deleting the original:

echo "Getting md5sum of original file"
origmd5=`zcat $file | md5sum`
echo "Original md5 is $origmd5"
echo "We're going to dedupe $file"
zcat $file | zbackup --threads 2 backup repo/backups/$file

restoredmd5sum=`zbackup restore repo/backups/$file | md5sum`
echo "md5 of test restore file is $restoredmd5sum"

if [ "$origmd5" = "$restoredmd5sum" ]
then
    echo "$origmd5 = $restoredmd5sum so deleting original..."
    rm "$file.gz"
else
    echo "ERROR: md5sums do not match: $origmd5 != $restoredmd5sum. Not deleting original."
fi

This has worked great and now in one case we currently have 148 deduped copies
of an 87G database using only 104G of disk space. Awesome.

-- 
Tracy Reed, RHCE     Digital signature attached for your safety.
Copilotco            PCI/HIPAA/SOX Compliant Secure Hosting
866-MY-COPILOT x101  http://copilotco.com

Attachment: pgp7zyrEAD55L.pgp
Description: PGP signature


References