… don’t forget to skip over directory names “.” and “..”. I omitted that little “detail” last night and ended up writing code that went berserk and tried—with a fair degree of speed and success—to delete virtually every file on my computer.
Luckily I had planned for such contingencies—my computer backs up all my files on a nightly basis—and was able to restore my files without much trouble. I had a scary moment when it looked like my program had wiped out the backup files as well, but through a combination of planning and luck (the directory that holds the backup files is actually a “junction” or “symbolic link” that points to a separate hard drive dedicated to holding backup files, and my program luckily did not understand how to recurse into it) the backup turned out to be intact.
That scare alone was enough to convince me that I need a removable backup solution—one that would allow me to, once a week, remove the backup medium and store it in a safe place, alternating or rotating between two or more such media. Until a few years ago I had always used backup drives that stored files on magnetic tape, but I’ve found that such drives are prohibitively expensive for casual users and their storage capacities haven’t kept up with that of hard drives. With that in mind I can state the requirements for a backup solution:
- Low-cost (which precludes high-capacity tape drives);
- Enough capacity for dozens of gigabytes (which excludes writeable CDs or DVDs);
- Unattended, automated operation (which again excludes CDs/DVDs);
- Very high transfer speed (which excludes network-based solutions).
At first it seems like I want to have my cake and eat it too, but I believe that the latest FireWire or USB2-attached hard drives will fit the bill.