Tech Note: Database Backup Revamp

• Views: 1,812

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.

Jump to top

Create a PageThis is the LGF Pages posting bookmarklet. To use it, drag this button to your browser's bookmark bar, and title it 'LGF Pages' (or whatever you like). Then browse to a site you want to post, select some text on the page to use for a quote, click the bookmarklet, and the Pages posting window will appear with the title, text, and any embedded video or audio files already filled in, ready to go.
Or... you can just click this button to open the Pages posting window right away.
Last updated: 2023-04-04 11:11 am PDT
LGF User's Guide RSS Feeds

Help support Little Green Footballs!

Subscribe now for ad-free access!Register and sign in to a free LGF account before subscribing, and your ad-free access will be automatically enabled.

Donate with
PayPal
Cash.app
Recent PagesClick to refresh
The Pandemic Cost 7 Million Lives, but Talks to Prevent a Repeat Stall In late 2021, as the world reeled from the arrival of the highly contagious omicron variant of the coronavirus, representatives of almost 200 countries met - some online, some in-person in Geneva - hoping to forestall a future worldwide ...
Cheechako
5 days ago
Views: 154 • Comments: 0 • Rating: 1
Texas County at Center of Border Fight Is Overwhelmed by Migrant Deaths EAGLE PASS, Tex. - The undertaker lighted a cigarette and held it between his latex-gloved fingers as he stood over the bloated body bag lying in the bed of his battered pickup truck. The woman had been fished out ...
Cheechako
2 weeks ago
Views: 320 • Comments: 0 • Rating: 1