17 messages in com.mysql.lists.mysqlRe: Recommended backup scripts for my...| From | Sent On | Attachments |
|---|---|---|
| Andreas Widerøe Andersen | 27 Jun 2006 02:44 | |
| Daniel da Veiga | 27 Jun 2006 04:19 | |
| Timur Izhbulatov | 27 Jun 2006 04:45 | |
| Dan Buettner | 27 Jun 2006 05:49 | |
| Tim Lucia | 29 Jun 2006 04:25 | |
| Gerald L. Clark | 29 Jun 2006 06:06 | |
| Dan Buettner | 29 Jun 2006 06:26 | |
| Andreas Widerøe Andersen | 29 Jun 2006 07:43 | |
| Dan Buettner | 29 Jun 2006 07:53 | |
| Daniel da Veiga | 29 Jun 2006 08:01 | |
| Tim Lucia | 29 Jun 2006 14:35 | |
| Dan Buettner | 29 Jun 2006 15:01 | |
| Tim Lucia | 29 Jun 2006 16:06 | |
| Dan Buettner | 29 Jun 2006 16:25 | |
| Andreas Widerøe Andersen | 30 Jun 2006 00:46 | |
| Dan Buettner | 30 Jun 2006 05:17 | |
| Andreas Widerøe Andersen | 01 Jul 2006 03:52 |
| Subject: | Re: Recommended backup scripts for mysql databases![]() |
|---|---|
| From: | Timur Izhbulatov (Timu...@oilspace.com) |
| Date: | 06/27/2006 04:45:50 AM |
| List: | com.mysql.lists.mysql |
On Tue, Jun 27, 2006 at 08:19:41AM -0300, Daniel da Veiga wrote:
On 6/27/06, Andreas Widerøe Andersen <wod...@gmail.com> wrote:
Hi, I have a few FreeBSD servers running various web/database things and I'm looking for a good a reliable backup script that I can run through a cronjob. I'm currently running the latest version of mysql323, but will upgrade to version 4.1 soon aswell as upgrade most of the servers to the latest FreeBSD version.
Any good suggestions to a script that will back up my databases and make things ready for an easy restore if I need to?
30 23 * * * date=`date -I` && /usr/bin/mysqldump --opt -B -C -h<host> -<user> -p<password> <database> | bzip2 -c > path/to/backup/$date-<database>.sql.bz2
I guess it will work on a FreeBSD, its my own cron job here...
I would also suggest removing old archive copies:
MYSQL="`which mysql 2>/dev/null`" || MYSQL="/usr/local/bin/mysql" MYSQL_ARGS="--opt -h localhost -uuser -ppass db" ARCHDIR=/usr/local/db/blah NAME=db_dump
# Remove archives older than 64 days find ${ARCHDIR} -type f -mtime +64 | xargs rm -f
# Create new archives cd ${ARCHDIR} && mysqldump ${MYSQL} ${MYSQL_ARGS} > ${NAME}.`date +%Y%m%d`
Cheers,
-- Timur Izhbulatov OILspace, 26 Leninskaya sloboda, bld. 2, 2nd floor, 115280 Moscow, Russia P:+7 495 105 7245 + ext.205 F:+7 495 105 7246 E:Timu...@oilspace.com Building Successful Supply Chains - One Solution At A Time. www.oilspace.com




