Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm setting up an OS X 10.4 Tiger Server box - just for the fun of it rather than for any serious purpose. I'd like to run a simple backup script daily, regardless of whether any user is currently logged in, and I'd like the script to have access to an AFP share (a USB drive connected to an Airport Extreme base station). So I'm trying to mount the share at startup rather than at user login. I can mount the share from the command line with:

mount_afp afp://username:password@servername/sharename/ /Volumes/sharename/

...where "servername" is the name of the base station rather than the server I'm setting up. That works fine. I haven't had any luck trying to make the system mount the share at startup, though. Being an ex-Linux user, I naively went looking for /etc/fstab so I could add an entry for the share, but the mount command doesn't seem to see my entry. To my surprise, I haven't been able to find any help on this either on or on the rest of the web. It seems like a very simple task; is there a standard way of doing this?

share|improve this question

It's probably simplest to create a StartupItem. Take a look at the ones in /System/Library/StartupItems for examples, as well as some useful scripting idioms (NFS is probably a particularly relevant example). Be sure to put your item in /Library/StartupItems (/System/Library is core OS components, /Library is for local customization).

You could also create a LaunchDaemon, which're intended to be replacements for StartupItems. In this case, however, that'd require you to do more work to control timing (i.e. make sure you don't try to mount the share point before the network's up).

share|improve this answer
Welcome to the ranks of the Stackathletes. – Dennis Williamson Nov 27 '10 at 15:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.