Back up your data!!! (or, The Disaster That Wasn't) - 2 minute read


This is your data:














This is your data without a backup:



Any questions?

This is especially important in programming because your data is your work product.

Seriously - back up your data.  Frequently.  And keep an offsite copy.  I saw this first-hand this last week: my experience as a server administrator made me realize the need for quick system-level recovery, so during the web development course I'm in I wrote a bash script that:

  1. Runs a git command to track all changed files.
  2. Runs a git commit.
  3. Runs a git command to send that commit to GitHub.
  4. Runs a TimeMachine backup.
This gives me a TimeMachine restore point every time I make a git commit, and I only have to run one command to do four things (the syntax is at the bottom of the blog).

What I didn't know is that it would come in handy last week: last week was project week, which means that I was put in a group and told to build a full-stack application in four days.  On day two, the service that runs that lets me talk to my MongoDB database . . . . wouldn't run.  Period.

Aargh!

With zero time to troubleshoot (we only had four days to make the application), I did pair programming with a colleague for the rest of the day.  That night, in less than an hour, I restored my computer back to a time when it was working, worked some more on the project, and we got the project done on time.

For people who don't have a backup administrator:

Automate frequent backups.  It'll take a while to read up on it, but it'll save you time down the road:
Time Machine (Mac)  use tmutil from the command line to run a backup after setting it up

For people who have a backup administrator:
  1. Talk to your admin at least monthly.  Things change, and it's best if the backup team is in the loop.
  2. Ask how often you data is protected.
  3. Ask if your OS and application are supported by the backup software (be specific down to the service pack level).
  4. Ask if server-level or application-consistent restores are available.
  5. Ask if your database is supported by the backup software (be specific down to the revision / service pack level).
  6. Talk to the backup admins again BEFORE installing service packs or upgrading your database version.
If you do 1 - 6 above, especially #6, your backup admin will love you!!! There's no worse feeling for a backup admin than being told, "Yeah the development team just upgraded to (<this new software>) two weeks ago .. . ."  Because the panicky klaxons of "Man, is that compatible with our software?" will immediately sound off in his or her head.


Syntax for automating commits, uploading to GitHub, and backups on a Mac (assumes you're on a git branch called 'dev'):
git add -A;git commit; git push origin dev; tmutil startbackup --auto



Comments

Popular posts from this blog

Optional object property access

A short guide to cross-site request forgery attacks

How is an application like a bride's outfit? - 1 minute read