Another tip is to store the backup on a separate physical disk and tape to
the actual database, because if they are on the same device, and that dies,
then there goes your back up too!

Quentin

-----Original Message-----
From: Dan Adams [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 1 March 2001 8:21 a.m.
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: how to backup mySQL database?


This is the way i do it: 
- write a script that will run mysqldump on the database of choice and then
pipe the result though gzip (this is only to reduce the size)
- the script also copies the new backup over the old one where every you may
be backing it up
- run this script with cron every night or whenever you want to do backups
- write another script which rotates the update logs and install the script
under crontab also

when you need to restore a backup just recreate the database you need to
restore and pipe the last database backup through the mysql program. then do
the same with the most recent update script. this should restore your
database to the point at which it was when the bad stuff happened.

Here are my scripts:

backupdb:
#!/bin/sh

backupdir=/usr/backup
bindir=/usr/local/bin

rm $backupdir/$1.gz
$bindir/mysqldump $1 | /usr/bin/gzip > $backupdir/$1.gz


rotate-update-logs:
#!/bin/sh
# only keeps 2 logs

base=servername
datadir=/usr/local/var
bindir=/usr/local/bin

cd $datadir
mv $base.002 $base.001
$bindir/mysqladmin flush-logs

These are just basic scripts but they work for me. I hope this helps.
  - Dan

On 2003-04-29 00:06:05, Keneth wrote:
> Anyone know how to backup mySQL database?
> 
> with best regards,
> TOM
> 
> 
> 
> 

Posted via Project Horizon
http://www.projecthorizon.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

The information contained in this email is privileged and confidential
and intended for the addressee only. If you are not the intended 
recipient, you are asked to respect that confidentiality and not 
disclose, copy or make use of its contents. If received in error 
you are asked to destroy this email and contact the sender immediately. 
Your assistance is appreciated.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to