Hello,

I just came into this conversation mid way, but I wanted to include a script I use
via cron to do mysql backups. Not sure if someone already provided this.

[EMAIL PROTECTED] ~]$ crontab -l
0 */23 * * * /path/to/sql_backup.sh

[EMAIL PROTECTED] ~]$ cat sql_backup.sh
DATE=`date '+%m%d%Y'`
DUMPFILE="/path/to/all_databases-$DATE.sql.gz"
/usr/bin/mysqldump --all-databases --user=root --password=changeme | gzip > $\
DUMPFILE

- Ben
----- Original Message ----- From: "Anthony Wlodarski" <[EMAIL PROTECTED]>
To: "'NYPHP Talk'" <[email protected]>
Sent: Wednesday, October 03, 2007 4:13 PM
Subject: RE: [nyphp-talk] Scripting to get a backup of yourcurrent MySQL database.


I assume a ten minute window as I have not done it before.  I am going to
have Cron call that script but just to make sure at the start of the script I am going to make sure people don't have access to the CMS so the database
doesn't try to update itself.  I found that link useful, actually found it
before I posted on the user group.

Anthony Wlodarski
Senior Technical Recruiter
Shulman Fleming & Partners
646-285-0500 x230
[EMAIL PROTECTED]


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Rob Marscher
Sent: Wednesday, October 03, 2007 2:43 PM
To: NYPHP Talk
Subject: Re: [nyphp-talk] Scripting to get a backup of your current MySQL
database.

On Oct 3, 2007, at 12:16 PM, Anthony Wlodarski wrote:
I think for sake of ease of doing this project we will just have a ten
minute drop on the server at midnight every night to backup the
database.
I doubt it will take 10 minutes.  From http://dev.mysql.com/doc/
refman/5.0/en/backup.html:

"You can also create a binary backup simply by copying all table
files (*.frm, *.MYD, and *.MYI  files), as long as the server isn't
updating anything. The mysqlhotcopy script uses this method. (But
note that these methods do not work if your database contains InnoDB
tables. InnoDB does not store table contents in database directories,
and mysqlhotcopy  works only for MyISAM tables.)"

_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php



_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to