MLUG: [MLUG] RE: MySQL backups (WAS basic Unix pipe/exit code problem)
[MLUG] RE: MySQL backups (WAS basic Unix pipe/exit code problem)
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
If you're trying to backup MySQL, there's a decent Perl script for this
purpose here:

http://worldcommunity.com/opensource/utilities/mysql_backup.html

I use this for a couple production servers, and it's a lifesaver.

I've cooked up something similar for small web sites which don't have
the space to handle all the dump files. It's a long pipe-fitting. Here's
a sample:

#!/bin/bash

#get today's date/time
today=`date +%Y%m%d_%H%M`

#run the dump and mail it to me
/usr/bin/mysqldump --quick --add-drop-table -c -l my_table_name |
/bin/gzip | /usr/bin/uuencode $today-my_table_name.gz | /bin/mail
EMAIL:PROTECTED -s "MySQL Backup - $today - my_table_name"

Every once in a while, I just delete the old backup mail messages. Could
I automate it more? Probably. I'm too lazy, though.

_______________________________________________
HARDY POTTINGER <EMAIL:PROTECTED>    .
Programmer/Analyst - Expert                   .
Univ. of Missouri, Office of Library Systems  .
 GPG Public Key...                            .
   http://mco.mobius.missouri.edu/~hardy/     .
 worth a look...                              .
   http://www.weitz.de/regex-coach/           .
   http://www.mepis.org/                      .
. . . . . . . . . . . . . . . . . . . . . . . .

_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members