Date: Tue, 30 Sep 2008 16:12:35 -0700 From: Chris Pratt <eagletree@hughes.net> To: John Almberg <jalmberg@identry.com> Cc: freebsd-questions@freebsd.org Subject: Re: Best way to back up mysql database Message-ID: <7F7FCA1B-E46C-4A44-9569-D6638A550FCE@hughes.net> In-Reply-To: <835F48BA-494E-44A0-8D2B-D9F139AB2125@identry.com> References: <835F48BA-494E-44A0-8D2B-D9F139AB2125@identry.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> > I am just about to dive into Google in search of a solution, but > thought I would fire off a quick request, in case there is an > obvious solution that everyone uses. If there is, a name or URL > will do. I'll figure out the rest. > > Any hints much appreciated. Not going home until this is fixed... > > Most certainly would want you to not not go home having been there before. Here is a crude way to do this. Find an elegant solution at leisure. The downside is that you if you crash at the wrong time, your job won't start for the next day. Be forewarned, then you stop making backups. You just need to monitor your atq. The gzip step should probably be part of a pipe for efficiency. You could cron this to get around that. I saw the response about repairing corruptions, REPAIR TABLE has thus far kept me from ever reloading. See man on date and use something other than %a to generate a numeric date unique back, that would give you numerous backups if you have the storage. DATE=`date +%a` # echo $DATE # echo Backup Mysql database mysqldump -h localhost -u YOURSQLUSERID -pYOURPASSWORD YOURDATABASE >/ usr/somedirectory/somefile_$DATE.backup gzip -f /usr/somedirectory/somefile_$DATE.backup /usr/bin/at -f /usr/somedirectory/mysqlbackup.sh midnight
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7F7FCA1B-E46C-4A44-9569-D6638A550FCE>