Overly Sharpened Blog

They never told me what happens when you sharpen the saw too much...

Minimum Standards

You're a knowledge worker.

A fancy term that just means you use your computer for actual honest real creative work. Not talking about time-sheets and a contact list here. That spreadsheet that serves as your companies ERP. The irreplaceable original files making up your portfolio. The curriculum for the class you're teaching. The knowledge that you've gained and reified into something communicable. These things have value. But only as long as they exist.

This feels like a good time to point out that your hard drive is probably going to die this year. "Oh."

Okay, maybe not this year. Really, it's only a 5% chance or so. But a 5% chance of an unrecoverable loss of data is enough to keep me up at night. There are many things that can cause you grief in this department.

The point is to acknowledge that the universe tends towards maximum irony and to start acting like failures are expected, so that when they happen you're not left with the choice of redoing a month's work, or a $5,000 recovery bill, or simply being forced out of business because that information was both truly irreplaceable and irrecoverable. All you need is a minimum standard of care. You wear your seatbelt when driving. You have working smoke detectors where you sleep. And you have automatic nightly backups of your data.

Well, you will, soon enough. :)

  • Backups

  • The common wisdom: "You need backups! What if the building burns down?"

    This is not why you should have backups. The common wisdom is really just a ready-made statement to show that you think about Big Problems, while giving you an excuse procrastinate and generally ignore the issue. Yes, it's a problem that should be addressed, but our goal today is the minimum standards of hygiene, and worrying about redundancy and geographic distribution and backup windows is just going to overwhelm you and give you an excuse to give up on the whole thing. And we're not giving up today.


    No, you're going to get your backup situation figured out because your hard drive is going to die this year. Yes, really. Hard drives have lifetimes measured in years, not decades. And your machine isn't exactly new, is it?

    We're going to do a daily backup. Backups are annoying because they take a long time to copy everything, and the machine is slow due to the extra load on the disk while they're running. But if you back up every day, then you only ever have one day's worth of extra data to move.

    We're going to back up everything. Every day. Getting selective and only backing up particular files is a very good way to ensure that you're missing only the most vital files. Trust me, you don't want there to be any question that that work you did last week for the first time in a new program is being included.

    And, we're going to back everything up every day, automatically. It's vitally important that the backup happens whether or not you remember to start it. And running it by hand will tempt you into doing changing the process by hand, and for this task inconsistency is your absolute enemy.

    We want an automatic process that backs everything up every day.

  • So, what tool do we use for this?


  • The common approach is to use a nice point-and-click tool to run the backups. You should not use one of these tools.

    Transparency is your ally in this task. You need to understand each link in your backup process in as much detail as you can, and this means minimizing the number of links in the chain. Point-and-click tools excel at creating intricate setups that are not the simplest thing that could possibly work.

    You're going to need three things. You already have two of them.

    • External Drive

    • You need an external drive that plugs into your computer using a USB cable or similar. This shouldn't set you back more than $100-$150, but it's not optional.

      Backing up to CDs or DVDs practically guarantees that you won't perform the backups on a regular basis, and makes the whole process far for painful than it needs to be.

    • Scheduler

    • On any modern unix (Linux, BSD, Apple's OS X, and so on), the scheduler will be cron. Commonly, there will be a folder called /etc/cron.daily, and any script placed in that folder will be run once per day at a suitable time. Exactly what we need.

      On windows, there's typically a built-in scheduler service which is adequate for the task.

    • Copier

    • Again, the tool we need is already available on any modern unix. The rsync tool will reliably copy everything, automatically checking that everything was written correctly, and keeping any special data necessary that other tools may not include.

      On windows, I'd strongly recommend grabbing a copy of rsync from cygwin or wherever.


    What we want is a very simple script, so simple that you can understand it.


    #!/bin/bash

    # -v Print the names of the files to the screen as we back them up.
    # -a Do the things necessary to give a nice complete archive of a set of files:
    # -x Don't go exploring mount points that we run across
    # --delete Delete files files from the backup if they're no longer found.
    # / The source: copy everything from the root drive.
    # /media/disk/backup/root The target: copy everything to here.
    rsync -vax --delete / /media/disk/backups/root


    Save this in a file called "backup", and added it to your /etc/cron.daily folder. Tomorrow morning, check that your external drive has a copy of all your data on it, and bask in a warm glow knowing you're doing better than 90% of your peers.

    Much better, right?

    0 Comments:

    Post a Comment

    << Home