Tech Note: Database Backup Revamp

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

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? 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

► 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.

A cute, likable, heavy build-child.

TwitterFacebook
LGF Pages
Recent Pages

Channeling Confucius
The 7 Most Terrifying Archaeological Discoveries
1 hour, 16 minutes ago
Views: 71 • Comments: 0
Tweets: 0 • Rating: 0

Aigle
Ha'aretz, Lost in Translation
2 hours, 12 minutes ago
Views: 66 • Comments: 3
Tweets: 0 • Rating: 0

Randall Gross
Government Employment Drops Under Obama, but Media Run With Romney Myth Anyway
4 hours, 2 minutes ago
Views: 136 • Comments: 0
Tweets: 6 • Rating: 1

researchok
French Philosopher Alain Badiou on the Real Expression of Love: 'If You Limit Yourself to Sexual Pleasure It's Narcissistic'
8 hours, 7 minutes ago
Views: 87 • Comments: 0
Tweets: 0 • Rating: 0

Haywood Jabloeme
Closing the Racial and Generational Divides
11 hours, 56 minutes ago
Views: 92 • Comments: 0
Tweets: 0 • Rating: 1

Aziz Poonawalla
I Speak for Myself: All-American
15 hours, 52 minutes ago
Views: 137 • Comments: 0
Tweets: 0 • Rating: 5

Mostly sane, most of the time.
So wake up and notice already
2 days, 11 hours ago
Views: 294 • Comments: 0
Tweets: 2 • Rating: 7

Daniel Ballard
Late Afternoon Light-Kalanchoe
3 days, 15 hours ago
Views: 270 • Comments: 0
Tweets: 0 • Rating: 5

Eclectic Infidel
City College of San Francisco Budget Update
3 days, 16 hours ago
Views: 323 • Comments: 0
Tweets: 0 • Rating: 1

MichaelJ
Apple TV Slated to Debut in December?
4 days, 22 hours ago
Views: 372 • Comments: 0
Tweets: 0 • Rating: 1

 Frank says:

The worst aspect of 'typical familyism' (as media-merchandised) is that it glorifies involuntary homogenization.