I create the disks I store off-site on a server that has USB-attached boxes that accept bare drives. Whenever I load a brand new disk, I need to create the directory structure the Vice Versa expects. I used to do this manually, which was error-prone and boring. Now I use a script.
If you’re not familiar with scripts, they don’t have to be complicated (although they certainly can be if you want). Windows has an ancient scripting capability that dates back to MS-DOS. There is a more modern scripting language called PowerShell that’s supported by the later Windows OS’s.
The Mac OS X, being Unix with a pretty face, uses the Unix Bourne shell. Apple provides a very nice turorial here.
If you run Linux, you probably know all about shell scripts.
Here’s the script I use to create the directory structure for one of my off-site backup disks on a machine running Windows Server 2008R2:
You can create this file with any text editor that can write unformatted text files. You give it a file extension of .bat, so that the OS knows it’s a sequence of commands, and what language it’s written in. On Mac OS X and Linux machines, the details are different, but the idea is the same.
Here’s what the bat file does.
- The first line changes to the H: disk, which is assumed to be freshly formatted.
- The “md” (make directory) command creates a bunch of folders.
- The “cd” (change directory) changes to one of the newly-created folders.
- The next md command makes two more folders in the new directory.
- The next cd command changes to one of the new folders.
- The next md command creates two more folders in the new directory.
After I run the script, the directory structure on the disk looks like this:
- Classical
- Data
- Desktops
- …..Honker
- ……….Desktop
- ……….Docs
- …..Alice
- Goodsync
- iTunes
- MP3s
- Pop1
- Pop2
- Programs
Leave a Reply