Tech Note: Database Backup Revamp

• Views: 1,830

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
Ranked-Choice Voting Has Challenged the Status Quo. Its Popularity Will Be Tested in November. JUNEAU — Alaska’s new election system — with open primaries and ranked voting — has been a model for those in other states who are frustrated by political polarization and a sense that voters lack real choice at the ...
Cheechako
5 days ago
Views: 176 • Comments: 0 • Rating: 0