Tech Note: Database Backup Revamp

Charles Johnsonfollow me on twitter
Thu Apr 17, 2008 at 6:12 pm PDT • Views: 181

Stinky and I are finally getting around to a much needed redesign of the backup system for our MySQL database, to give us regular nightly automatic backups instead of the semi-manual backup we’ve been doing. Imagine the great noise that would issue forth from the lizard army if the server crashed and we lost a week’s worth of comments.

The new system has two parts:

* On the DB server, a cron job calls a shell script that renames the current backups with a .bak extension, then uses mysqldump to dump out the database tables needed to recreate LGF if disaster strikes.

* On our desktop Mac, a cron job calls the ‘rsync’ command to connect to the database server through SSH (an hour or so after the server’s cron job runs), and synchronizes the folder containing those dump files to a local folder.

Rsync is smart; when a file exists on the destination (our office Mac), it only downloads the changed section of the file and merges it with the existing one. This saves an enormous amount of time and bandwidth, especially on the 2.5GB+ dump of our comments table.

And because it connects through SSH, the transfer is encrypted and as secure as possible.

This system gives us a two level backup system on the DB server, but since our local computer also uses Apple’s Time Machine backup system, we actually have the ability to restore from even further back if it’s ever necessary.

Backups within backups.

And now… the open thread.

Advertisement

1335 comments

^ back to top ^

Name:

Pass:

Register Forgot Your Password? Account Settings Re-send Confirmation (To log in, cookies must be enabled in your browser!)

Turn off ads by subscribing!
For about 33 cents a day, our subscription option turns off all advertisements at LGF!
Read more...


► LGF Headlines

  • Loading...

► Tweeted Articles

  • Loading...

► Tweeted Pages

  • Loading...

► Top 10 Comments

  • Loading...

► Bottom Comments

  • Loading...

► Recent Comments

  • Loading...

► Tools/Info

► LGF Hits

► Resources

► Never Forget

► Statistics

► Tag Cloud

► Contact

You must have Javascript enabled to use the contact form.
Your email:

Subject:

Message:


Messages may be published in our weblog, unless you request otherwise.
Tech Note:
Using the Contact Form

More Partners

Compare Electricity Prices in your area. Texas Electricity is deregulated; you have the right to choose Texas Electric Rates from among many Texas Electric Companies.

Play nice.

TwitterFacebook
LGF Pages
Recent Pages

Channeling Confucius
Wherefore Art Thou ACLU? Only certain civil liberties need apply. - Charles C. W. Cooke - National Review Online
17 minutes ago
Views: 12 • Comments: 0
Tweets: 0 • Rating: 0

Channeling Confucius
6 Pop Culture Mysteries That Were Solved by Fans
22 minutes ago
Views: 16 • Comments: 0
Tweets: 0 • Rating: 0

Randall Gross
Trial opens 2 years after feds break up Christian militia
2 hours, 44 minutes ago
Views: 90 • Comments: 0
Tweets: 0 • Rating: 0

Randall Gross
Obama's budget headed to Congress
2 hours, 59 minutes ago
Views: 106 • Comments: 0
Tweets: 0 • Rating: 0

researchok
Dreyfus and the Birth of Intellectual Protest
5 hours, 48 minutes ago
Views: 89 • Comments: 0
Tweets: 0 • Rating: 1

researchok
Mitt's Spin
5 hours, 53 minutes ago
Views: 80 • Comments: 0
Tweets: 0 • Rating: 0

researchok
Strategy
5 hours, 54 minutes ago
Views: 65 • Comments: 0
Tweets: 0 • Rating: 0

researchok
Gender Wage Gap Skewed by Survey Flaws - Miller-McCune
5 hours, 54 minutes ago
Views: 71 • Comments: 0
Tweets: 0 • Rating: 1

researchok
Why Obama Would Be Glad if the Culture War Is a Major Election Issue
5 hours, 55 minutes ago
Views: 95 • Comments: 0
Tweets: 0 • Rating: 1

researchok
Is This the End of Wall Street as They Knew It?
5 hours, 55 minutes ago
Views: 82 • Comments: 0
Tweets: 0 • Rating: 1

 Frank says:

I think you should leave it up to the parent, because not all parents want to keep their children totally ignorant. -- Frank Zappa in response to a question from Senator Hollings.