TurboManage

David Chandler's Journal of Java Web and Mobile Development

  • David M. Chandler


    Web app developer since 1994 and ex-Googler now residing in Peru with the wife of my youth and our three youngest children. I am working on a software development company and hoping to do more teaching as my Spanish improves. My current side project is a not-for-profit startup using GWT on AppEngine. In my "spare" time, I take pictures, preferably of Rocky Mountain National Park... or Peru.

  • Subscribe

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 220 other followers

  • Sleepless Nights…

    November 2009
    S M T W T F S
    « Oct   Dec »
    1234567
    891011121314
    15161718192021
    22232425262728
    2930  
  • Blog Stats

    • 608,198 hits

Archive for November 21st, 2009

A comprehensive PC backup strategy

Posted by David Chandler on November 21, 2009

“The Saturday Evening post”

Have you ever thought about exactly why you make backups? What are you trying to protect against? Fire? Thieves? Accidental deletion? A few months ago, a friend’s desperate Saturday night phone call vividly reminded me of why I make backups. “David? Um, my daughter was finishing her 200-page novel that’s due Tuesday, and our computer has just died. As in won’t boot. Is there anything you can do?” Of course, they had no backups.

I don’t have the data in front of me to prove it, but experience suggests that the most likely reason you’ll ever need a backup is hard drive failure, with malware /virus infection probably running a close second. Here’s the strategy I’ve developed over the years:

  1. Put all your data files in one directory structure so you can easily copy it. I use a folder named “C:\@My” with subfolders for documents, music, pictures, etc. The @ causes it to show up first in alphabetical directory listings, which is convenient. In Windows Vista (and maybe XP?), you can use this system and still retain the convenience of your Windows user home folder (containing Documents, Music, Pictures, etc.) that shows up in all the standard file dialogs. Simply right-click on, say, David\Documents, click Properties, select the Location tab, and point it to¬† C:\@My\Documents instead. The reason I don’t just back up my Windows user folder is because Windows stores the whole user profile there, including a lot of stuff that’s not really data per se.
  2. Forget about backing up all your applications. Just keep your original CDs and serial numbers somewhere you can find them. The PC is expendable–your data isn’t. I’m sure there are solutions that will backup the whole operating system and all installed software, but for me it’s not worth the extra time or space it takes to run backups. The exception is applications you’ve purchased via download. I keep these in @My/Downloads along with a text file for each containing the installation key (or find it in Gmail, since it was likely emailed to me when I purchased it).
  3. Each year, less and less of my critical data exists solely on my PC. Nowadays it’s on my iPhone or GMail. I moved my iTunes folder under my @My directory so the phone gets backed up–see Edit | Preferences | Advanced, and I trust Google not lose my mail, though I’m not completely sure why–what if someone hacked my account and deleted all my mail?!?!#@? I guess I really should set up the POP3 account for Gmail with a local email client like Outlook and back that up, too.
  4. At any rate, let’s get to backing up. I back up smaller files like Quicken data (be sure to move this under @My, too), documents, and photos, on a nightly basis using an online backup solution, iDrive.com. With iDrive, I can store up to 2GB for free, and it’s only $50/yr for up to 150 GB. This is my first line of defense against hard drive failure. My data goes off site every night, and I don’t have to think about it.
  5. For larger files like RAW photos and video (as well as small ones), I backup the whole @My folder to an external hard drive every few days using Karen’s Replicator as I blogged about last week. The name of the game here is speed, and for that, you’ll want a hard drive (and computer) with an eSATA interface. I’ve been very happy with my LaCie 1TB external drive. On a recent typical backup run, Karen’s Replicator processed 62,702 files and copied 400 new or modified files totaling 5.5 GB to the LaCie in 8.5 minutes. Most HP and Toshiba laptops now have an eSATA port. You could backup RAW photos and other large files online, too, but DSL upload speeds are so slow that it may be impractical depending on how much new data you create each day.
  6. For large items of sentimental value like photos and videos that are not backed up online, I burn a DVD once a year and drop it in my bank’s safe deposit box in a Ziploc bag (think sprinkler system malfunction). That way, even if I lose both my PC and external drive, I won’t lose more than a year’s worth of digital memories.

Following this strategy, all your data except RAW photos and video always exist in three places: your PC, external hard drive, and in the cloud (online). For extra peace of mind for larger files not backed up online, you could get a second external hard drive and always keep one in your bank’s safe deposit box in a Ziploc bag (think sprinkler system malfunction).

As of this writing, all of my accumulated digital assets take up 168 GB. That already fits easily on a portable hard drive (though I haven’t yet found one with the faster eSATA interface). Within a few years, it will fit on a USB flash drive, I expect. In fact, it would almost fit on this kind of flash drive today. Buy a couple of these along with an eSATA hard drive enclosure from Fry’s and you’ll probably spend more time swapping backup drives at the bank than you will backing up your whole file system every day…

By the way, my friend’s story had a happy ending. I dropped the hard drive containing the novel into a USB hard drive enclosure I bought for $13 at my local Fry’s, plugged it into the USB port on another PC, and recovered all the data. External hard drive enclosures are cool. Fry’s is cool, too.

Posted in PC Tech | 2 Comments »

Weird serialization error in AppEngine

Posted by David Chandler on November 21, 2009

My previous post discussed a very cool way to do background processing in AppEngine using Deferred.defer. Unfortunately, the AdminEmailTask example I posted results in a cryptic error when the task is dequeued and the Deferred servlet attemps to deserialize it:

com.newatlanta.appengine.taskqueue.Deferred deserialize: invalid type code: 00

After nearly a day’s worth of experimentation, I am really weirded out by what I’ve found: the problem seems to be the name of the private field “msgSubject” in AdminEmailTask. I tried shorter names, longer names, and other names without any problem. I changed the class name, moved it into a different package, and generally pulled my hair out until I simply tried changing the name of the field. At first, I thought it was this JDK bug, but I wasn’t using an array type. Nevertheless, I subclassed ObjectInputStream and overrode the resolveClass method as per the bug’s workaround, only to find out that AppEngine’s implementation of ObjectInputStream doesn’t call the overridden resolveClass and throws a security exception on enableResolveObject(true).

I can only guess that the field name “msgSubject” results in a binary sequence that is somehow special to AppEngine’s implementation of ObjectInputStream, or perhaps it’s a bug in the JDK.

At any rate, if you get the java.io.StreamCorruptedException with invalid type code: 00, try renaming your class fields! I really, really hope I’m mistaken about this.

Posted in AppEngine, Headsmack | 1 Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 220 other followers

%d bloggers like this: