AppleScript

I’ve been having a problem at work with the server that out Library’s catalog system is run on. Like all System Administrators, I like to have this server backed up on a regular basis — nightly if possible. We usually use a program called Backup Exec by Veritas to do this sort of thing and they have a client for Mac OS X Jaguar, which is the operating system this server runs on.

Backup Exec is an extremely powerful backup software package, but it is also extremely frustrating. A couple of weeks ago, the backups of this server began failing. I have no idea why they began failing and honestly have not had the time to figure whether the problem is the server or the client. I ended up doing what all Sys Admins have done: I starting copying the data to another server that the backups were working on. The problem is that I was doing this by hand and that is a real drag to do.

Today I had a breakthrough. First, let me say that I’m no computer programmer. Oh sure, I took a year’s worth of computer programming in college (Pascal and LISP), but that certainly doesn’t make me a programmer. What I did today was write an AppleScript. If you aren’t familiar with it, AppleScript is a scripting language that is built into the Macintosh OS and can be used to do all kinds of amazing things. I’ve always known that AppleScript was there, but up until today I’ve never utilized it.

I spent a couple of hours this afternoon reading about how AppleScript works and examing a whole bunch of scripts that others had written. I took the information I learned and combined and tweaked about four scripts to accomplish my task. The task was for the Library catalog server to log in to our staff file server, empty the contents of the directory that I had specified to hold the copies of the catalog server’s database, copy a new set from the catalog server to the file server and then log out. Just before I went home, I got it to work. Yahoo!

The next step is to set up Cron to run that script once a day. I suspose I should also put some error handling in it. I would also like it to somehow notify that it successfully completed the job. Hmmm…. I guess I have some more work to do on it. I still feel pretty good abou it though.

–Pete