NYCPHP Meetup

NYPHP.org

[nycphp-talk] Scripting to get a backup of your current MySQL database.

Anthony Wlodarski aw at sap8.com
Wed Oct 3 10:34:48 EDT 2007


I will set cron to run the scrip tonight and I will let you know how it
goes.

 

Anthony Wlodarski

Senior Technical Recruiter

Shulman Fleming & Partners

646-285-0500 x230

aw at sap8.com

 

From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Cliff Hirsch
Sent: Wednesday, October 03, 2007 10:25 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Scripting to get a backup of your current MySQL
database.

 

I'm no expert, but it that's the case, I believe you can just use
mysqlhotcopy, without stopping the database. Even if it does a lock, it
should be very fast, since its a file copy, not a dump.

On 10/3/07 10:18 AM, "Anthony Wlodarski" <aw at sap8.com> wrote:

Cliff,
 
I believe we use MyISAM and after verifying it with phpMyAdmin all the types
for our tables are MyISAM.
 
Regards,
 

Anthony Wlodarski
Senior Technical Recruiter
Shulman Fleming & Partners
646-285-0500 x230
aw at sap8.com


From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Cliff Hirsch
Sent: Wednesday, October 03, 2007 10:04 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Scripting to get a backup of your current MySQL
database.

On 10/3/07 9:57 AM, "Anthony Wlodarski" <aw at sap8.com> wrote:
I was confused on the relevance of this topic but since PHP and MySQL go
together like PB&J I thought it would be relevant.  
 
It has gotten to the point that the application that I built for candidate
tracking is growing astronomically so now I was given the task of backing up
our data.  So far our Apache/Drupal installation is backed up and SCP'ed to
a secure server.  My one big problem is backing up our MySQL database.  Does
the script "mysqlhotcopy" have the same drawback as just copy the files
manually (frm, MYD, MYI) in the sense that the server can't be updating
anything.  To be honest I can't guarantee that no one in the office will not
be using the system at certain times so it might present a problem.  Would
it be easier to just to script something that follows this logic:
 
Pre: rename index.php, copy in temp file with downtime message
 
1.)   Stop daemon.

2.)   Copy all the table files *.frm, *.MYD, *.MYI files, tar/gzip them

3.)   SCP archive offsite

4.)   Delete temp folder

5.)   Restart daemon.

 
Post: delete temp file, rename file back to index.php
 
Is it unrealistic for my office to expect 100% uptime, even at 3:30 am in
the morning (those whacky recruiters).
 
Anthony Wlodarski
aw at sap8.com

First off, what engines do you use? Mysqlhotcopy does not work for the
Innodb engine.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20071003/a3a7d708/attachment.html>


More information about the talk mailing list