Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 am writing an Automator "script" that rsyncs media on my 10.6.3 MacBook Pro to my Ubuntu 10.10 HTPC. I can make Automator run my shell script for rsync commands, but I can't make Automator mount the three volumes on the HTPC (folders for music, videos, and pictures).

I automatically mount these volumes when I login, but sometimes the HTPC volumes get unmounted, so I'd like to remount by default.

Is there a way to mount the volumes in Automator? I am open to shell scripting, too. Thanks!

share|improve this question
This would be a great question for – Josh Newman Oct 19 '10 at 17:46
Why are there so many stackexchanges now? Does it help with ad revenue? Doesn't tagging work? I added it there, too. Should I delete this one? I am a relative newbie to stackexchange. – Richard Herron Oct 19 '10 at 17:59
up vote 2 down vote accepted

First you need to find out the name of your drive, i store it in a shell variable:

backupVolume=`diskutil list | awk '/ Backup / {print $6}'`

"Backup" is the name of my drive. Something like "disk2s1" will be stored in this variable. This part of the shell script mounts the drive:

if [ ! -z "$backupVolume" ]
  diskutil mount $backupVolume

To automatically eject a drive you can use this shell script:

osascript -e 'tell application "Finder" to eject "Backup"'

I hope this is what you meant.

share|improve this answer
Thanks! I'll try this tonight. Does it matter that the two computers connect via a wifi network? – Richard Herron Oct 19 '10 at 17:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .