How can I get Automator to mount a network quantity?

I am creating an Automator "manuscript" that rsyncs media on my 10.6.3 MacBook Pro to my Ubuntu 10.10 HTPC. I can make Automator run my covering manuscript for rsync commands, yet I can not make Automator mount the 3 quantities on the HTPC (folders for songs, video clips, and also images).

I instantly mount these quantities when I login (these computer systems connect using a wifi network), yet occasionally the HTPC quantities get unmounted, so I would certainly such as to remount by default.

Exists a means to mount the quantities in Automator? I am open to shell scripting, also. Many thanks!

0
2019-05-09 11:45:00
Source Share
Answers: 2

I construct automator operations similar to this regularly. You just require 2 activities, and also they're both Files & Folders activities.

1) Get Specified Servers. This will certainly allow you construct a checklist of shares to connect to. If you can map it from Finder - > Go - > Connect to web server, you can utilize this.

2) Connect to Servers. This will certainly connect to any kind of web servers passed to it (either from get defined web servers or from request for web servers).

0
2019-05-10 09:18:11
Source

I make use of the adhering to applescript to mount directory sites combined with MarcoPolo so network shares are instantly placed when I reach both my workplace and also residence.

You'll require to transform USERNAME, PASSWORD, SERVER/SHARENAME and also perhaps smb :// relying on your web server type.

tell application "Finder"
    try
        mount volume "smb://USERNAME:[email protected]/SHARENAME"
        delay 1
    end try
end tell

UPDATE : An alternative without MarcoPolo : You can sound the web server first and also just attempt to connect if you get a feedback. You can after that add this manuscript right into your Login Items

(Let's claim you are attempting to connect to a web server called "some_server")

-- (0) Check to see if there server exists by pinging it
set max_retry to 60
set k to 0
repeat while (do shell script "ping -c 1 some_server") contains "100% packet loss"
    delay 5
    set k to k + 1
    if k > max_retry then error "Server is not responding for predefined period." number 8000
end repeat

-- (1) It exists, mount the volume
tell application "Finder"
    try
        mount volume "smb://USERNAME:[email protected]_server/SHARENAME"
        delay 1
    end try
end tell
0
2019-05-10 06:59:24
Source