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]
Hardy,

Thanks for this.

Back to my original question:  In your script below, if mysqldump
fails with an error code, you will get emailed an incomplete dump. 
This is important for me, because I'm running mysqldump locally, where
were my dvd burner is, and the network could drop at any time.

Regards,
Mark
EMAIL:PROTECTED


On Thu, 3 Mar 2005 14:16:05 -0600, Pottinger, Hardy J.
<EMAIL:PROTECTED> wrote:
> 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/                      .
> . . . . . . . . . . . . . . . . . . . . . . . .
> 


-- 
You think that it is a secret, but it never has been one.
  - fortune cookie
_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members