Adam Rice

My life and the world around me

Tag: backup

Backing up your Delicious library on a Mac

The recent implosion of Ma.gnolia and a growing skepticism of entrusting your data to the cloud got me thinking about the data I’ve got that’s “out there.” One particular point of vulnerability is Delicious, where I keep my bookmarks.

Fortunately, Delicious makes it pretty easy to download all your bookmarks if you know what you’re doing. Unfortunately, you have to know what you’re doing, at least a little.

With that in mind, here’s a simple Applescript that any Mac user can run to create a backup. Delicious requests that you do this sparingly, so I’d recommend doing it only, say, once a week.

To make this work, open Script Editor on your Mac (it came with it, and should be lurking about somewhere unless you deleted it) and paste the following into it, changing the username and password. There may be a linebreak on the last line—edit it so that it is all on one line. Save it using “Application” as the file format with whatever name you like—this will result in a mini app that you can double-click to run.

Running it will create a file called deliciousbackup.xml in your Documents folder. That file will not be in the most readable format, but it will have all your data. Each time you run it, it will overwrite the previous version of the file. It would be possible to do multiple snapshots, but I haven’t gotten that fancy.

set thefile to "deliciousbackup.xml"
-- change myusername to your username, keep the quote marks
set theusername to "myusername"
-- change mypassword to your password, keep the quote marks
set thepassword to "mypassword"

-- this is where the magic happens
do shell script "curl https://" & theusername & ":" & thepassword & "@api.del.icio.us/v1/posts/all -o \"$HOME/Documents/" & thefile & "\""

Time Machine to NAS: Not quite there

I recently upgraded my Mac to Leopard, whose marquee feature is Time Machine, a nice backup mechanism.

I already had a NAS box. I originally got this primarily as a backup target. It’s got a half-terabyte hard drive in it, and it supports AFP, so it seems like a logical target for Time Machine backups. And apparently in the betas of Leopard, it was possible to use a hard drive attached to an Airport Extreme as a Time Machine target. This was disabled in the shipping version, but there’s a simple hack to re-enable it. Which I applied: as it happens, this made also it possible to use Time Machine with my NAS box.

One critical difference between my NAS box and a hard drive hanging off an Airport Express is the disk format. Time Machine requires an HFS+ disk. My box is using something else. Time Machine actually deals with this cleverly by creating a disk-image file on the target drive, but that’s also the root of the problem: Mounting this disk image over the network (even GigE) gets slower and slower as the file gets bigger and bigger. I had set up a very stripped-down backup profile (home directory only, no media files), but still, after a couple of weeks, it had gotten to 42 GB and took forever to mount. Eventually it took so long to mount that Time Machine would stop waiting for it and give up.

So until I get a Time Capsule or something, I’m using my previous backup app, Synk. Even after, it might be worth it to use Synk to back up my media files, which don’t need quite the obsessive hourly backup that Time Machine offers.

Adventures in backup

I’ve got an aging external hard drive that I’ve been using for backups for some time now. It’s been getting kind of clogged up, and when we returned from Spain, it took a few tries before it would spin up. That was the kick in the pants I needed to move forward with a plan to get a network-attached storage (NAS) box.

I spent a lot of time reading the reviews at Tom’s Networking. It looked like there was no one product that offered both of two key features: two disk bays for RAID-1, and support for the Appletalk File Protocol (AFP). (I know that I could have dropped $600 on a four-bay box from Infrant, but I literally don’t have room for that, much less the budget or the need.) I decided to compromise on a “bring your own disk” one-disk box from Synology, DS-106e, which at least supports AFP. Eventually I can get an external box to plug into the DS-106 and backup my backup.

Getting this working has been a bear. The main point of this exercise, of course, is to back up. I had been using SilverKeeper, freeware from LaCie, for a long time. It works, but it is not easy to work with. I want to exclude things like caches and deleted mail from my backup, and while it is possible with SilverKeeper, it’s painful, and the interface is buggy enough (straight outta OS 9) that I’m never sure what I’ve added to the exclusion list. I looked around and decided to try out Synk, which offers pretty smart exclusions and looks nice.

Repeated attempts to make a backup fail in mid-stream. Tried with both Sync and SilverKeeper, and encountered some variation on the same problem each time. I do some reading on the forums for Synk and discover that most NAS boxes that support AFP don’t do a very good job of it, hence the problems I’m seeing. Trying to connect via SMB doesn’t work any better, for some reason.

Gnash teeth, rend garments, pull hair.

Inspiration strikes.

If you’re using OS X and are trying to back up to an NAS without success, here’s what you do. Launch Disk Utilities. Create a sparse disk image on your NAS box. Make that your backup target. I’ve tried this, and so far, it works. It seems to tax my Mac a lot more heavily, and it seems like taking the long way round. There may be other reasons this is a Bad Idea, and I would rather not have to do this in the first place. But, like I say, it works.

On the plus side, the NAS box is a lot quieter than my external drive, it lets me declutter my desk. I hooked my printer up to it, for additional decluttering, and that worked like a charm. Hardware assembly went smoothly: I stuck a 500-GB (Half a terabyte. Isn’t that insane? My first hard drive was 20 MB, making this one 25,0000 times bigger. Terabyte-drives will be unexceptional in commodity PCs in a year.) drive in it, and over gigabit Ethernet, it seems about as fast as my FW-400 external hard drive.

Mobile backup

A friend taking an extended road trip just had her car stolen, with her laptop and everything else in it. That sucks massively. It got me thinking about the problem of maintaining backups and having access to them in a situation like that.

My home computer is a desktop. Currently I have it hooked to an external drive, and backup software runs in the wee hours every night to copy my home directory to the external. At some point in the near future, I hope to get a network-attached storage drive, so that I can A) liberate a little desk space, and B) move the backup away from the computer, in case something happens the computer. Admittedly, I’d only be moving the backup about 15 feet away, but a black box wedged into a cramped closet is much less likely to attract a thief’s attention, and if the roof collapses or something like that, fifteen feet might be enough. That’s what I’m counting on, anyhow.

But what about when you’re on the road? You need a backup medium that you keep separate from the laptop but still have ready access to, that is reasonably fast, and perhaps most importantly, is convenient to use. What are your options?

Before you can decide, you need to get your priorities in order. Some files are more critical than others; some change more frequently than others. Assuming that you will need to make compromises, you want to make sure the most current and most critical files are the most readily available and most frequently backed up.

Exclusive of media files, my home directory is about 5 GB. I’m guessing that about 1.5 GB of that is actually cache files and other digital ephemera, so to recreate my home directory, I’d need to be able to store about 3.5 GB. This would exclude all applications, music, videos, and photos. In reality, I could probably cut this in half by omitting a lot of archival files, though to do that I would need to reorganize my hard drive considerably. I’m lazy, so let’s stick with 3.5 GB as a target.

So, what are my options?

iPod
It just so happens that I have a 4 GB iPod Nano (rumor has it that these will be bumped to 8 GB soon). This would just accommodate me, plus a few hours of music or whatever. A hard-drive based iPod would have no trouble at all; in fact, I could store my home directory even with most of my media files on a 60 GB model. The potential problems here are that I would need to be scrupulous about keeping my laptop and iPod separate, and the temptation to keep music on the iPod, even if it cut into my storage requirement.
Network
My web-hosting company gives all its customers 20 GB of storage and webdav access. Webdav is pretty cool, because it lets me mount my network storage just like a hard drive on my desktop. A really, really slow hard drive, but there it is nonetheless. If high-speed connections could be taken for granted, this would be the ideal option—putting my storage in a remote datacenter that has its own redundant backups etc. But high-speed connections are hardly universal, and even when present, the upstream rate can be pretty slow. Backup software generally only backs up files that have changed since the last backup, but even with only 10 MB to back up, over a 128-Kbps upstream line, that will take at least 10 minutes (allowing nothing for communications overhead). In terms of convenience, this can’t be beat, assuming the connection is there. Make sure the remote volume is mounted and let the backup run. This is the only option that can be run unattended and still keep the backup volume physically separate. Having it on the server means I don’t need to even use my own computer to get at it; better still would be to have it in some web-readable format so that I could read it from any computer with a web browser. Thanks to Google, a lot of people are moving in this direction anyhow. I’m not entirely comfortable with that, and I get benefits from programs that run right on my computer that I’d be unwilling to give up, but perhaps if I had a more mobile lifestyle, I’d make a different tradeoff. And I do essentially do this already with my photos, by uploading them to Flickr.
Optical storage
Most newer laptops can burn to CDs at least, and in many cases to DVD. A single-side, single-layer DVD can store 4.7 GB, so I’m in the clear there. The drawback here is convenience: you need to go to more trouble to insert the disc, set up the burn session, burn the disc, label it, put it away somewhere, hope that it doesn’t get scratched before you need it, etc.
Flash drive
While this is technologically equivalent to the iPod Nano (and comes in the same storage sizes), I see a few key differences: there’s no particular temptation to use the flash drive for music, and you can hook it to your keyring. For this reason, I like this solution best for the most critical and current data: if the drive is on your keyring, you’re less likely to leave it connected to the computer. Well, I’m less likely, anyhow. This does require me to launch the backup manually, though.

I can imagine a multi-layered approach where I use a thumb drive as my primary backup for working files, bring a DVD that I burned in advance with some critical applications, occasionally burn a CD or DVD with photos (possibly snail-mailing it home), and occasionally upload my very highest-priority stuff to the server when I can take advantage of a fast connection.

© 2017 Adam Rice

Theme by Anders NorenUp ↑