RE: Best way to dump for daily archiving

2003-03-01 Thread Cal Evans
use the -opt flag. 

=C=

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: Scott Haneda [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 01, 2003 4:27 PM
To: MySql
Subject: Best way to dump for daily archiving


I wrote a sh script to use mysqldump to iterate through my databases and
dump them to .sql files, I am supplying no flags to mysqldump, and wonder,
is there a best way to dump your files, if the idea is they are backups
and to be used in the case of emergency.

-
Scott HanedaTel: 415.898.2602
http://www.newgeo.com   Fax: 313.557.5052
[EMAIL PROTECTED]Novato, CA U.S.A.


-
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



-
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



RE: Best way to dump for daily archiving

2003-03-01 Thread Don Read

On 01-Mar-2003 Scott Haneda wrote:
 I wrote a sh script to use mysqldump to iterate through my databases and
 dump them to .sql files, I am supplying no flags to mysqldump, and wonder,
 is there a best way to dump your files, if the idea is they are backups
 and to be used in the case of emergency.
 

Here's what I use :

---
#!/bin/sh
#
# dump database(s) each day --table by table
#

DBS=auth sales ar ap gl misc
DUMP=$HOME/archive/database
DIR=`date +%a`

cd $DUMP
mkdir -p $DIR
rm -f Today
ln -sf $DIR Todayauth
cd $DIR

for K in $DBS
do
TBLS=`mysql -N -e show tables $K`
for I in $TBLS
do
mysqldump -e -q --add-drop-table $K $I  $K.$I.dmp
rm -rf $K.$I.dmp.gz
gzip $K.$I.dmp
done
done

---

This gives a 7 day rotation, Mon-Sun.
With the latest dump in the 'Today' directory.

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)

-
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



Re: Best way to dump for daily archiving

2003-03-01 Thread Scott Haneda
on 03/01/2003 3:03 PM, Cal Evans at [EMAIL PROTECTED] wrote:

 use the -opt flag.

Can you tell me how to add in the username as well, I get a
./bin/mysqldump: invalid option -- o error

Here is the pertinent line
 /usr/local/bin/mysqldump -uUserName $db  $location$db.sql

-
Scott HanedaTel: 415.898.2602
http://www.newgeo.com   Fax: 313.557.5052
[EMAIL PROTECTED]Novato, CA U.S.A.


-
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



Re: Best way to dump for daily archiving

2003-03-01 Thread Gerald R. Jensen
Try ...

/usr/local/bin/mysqldump -uUserName --opt $db  $location$db.sql



- Original Message -
From: Scott Haneda [EMAIL PROTECTED]
To: Cal Evans [EMAIL PROTECTED]; MySql [EMAIL PROTECTED]
Sent: Saturday, March 01, 2003 5:18 PM
Subject: Re: Best way to dump for daily archiving


on 03/01/2003 3:03 PM, Cal Evans at [EMAIL PROTECTED] wrote:

 use the -opt flag.

Can you tell me how to add in the username as well, I get a
./bin/mysqldump: invalid option -- o error

Here is the pertinent line
 /usr/local/bin/mysqldump -uUserName $db  $location$db.sql

-
Scott HanedaTel: 415.898.2602
http://www.newgeo.com   Fax: 313.557.5052
[EMAIL PROTECTED]Novato, CA U.S.A.


-
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




-
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