Keep share mounted

I am planning on getting a mac mini for my home theater setup. however, after playing around with my MacBook Pro I have found that when the machine goes to sleep, any mounted shares are ejected.
I am looking for a script to do this:
If the share is mounted, the script quits, if not, then it mounts the share. I guess this would have to run every second or so, assuming the CPU doesn't become taxed. Any idea on how to do this? I had tried this with no luck:
on idle
tell application "Finder"
if disk "Videoshare" exists then
quit me
end if
end tell
return 1
end idle
tell application "Finder"
activate
open location "smb://servername/videoshare"
end tell
It continues to try and connect to the server, even if its already mounted. Any ideas?

A simple way to test for sleep is set your script to continually store the system time, and investigate further when it detects a jump.
click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">property last_date : current date
on idle
set new_date to current date
if new_date - last_date > 10 then
tell application "Finder"
if not (disk "Videoshare" exists) then
open location "smb://servername/videoshare"
end if
end tell
end if
set last_date to new_date
return 5
end idle</pre>You could also use a unix daemon I'm aware of. Note that since you're using this with an Intel processor, it will be more reliably saved as the "Application Bundle" (Universal) format, with the "stay-open" option checked of course.

Similar Messages

  • Keeping shares mounted

    I have a mini, and a usb net drive that keep my source files so they can be accessed by all computers (apple/win users) . I can access these resources and create network places on the win machines, but I have to "connect" to these on the mac each time I want to use them. Is there any way to keep a network share mounted perminantly on the macs?

    You should be able to drag the volume from finder over to the "Login items" window under "System Preferences/Accounts". The next time that you start up OSX will automatically connect to the desired volume. Make sure that you have saved the login password for the share in keychain or it will not work. Good luck.
    Cheers,
    D

  • How can I keep network shares mounted?

    With our new SSD (Retina MBP) we're trying to embrace the paradigm of using network storage, yet we keep running into a very aggravating wrinkle. Every time the wind blows, it seems, we lose our network shares. They have to be re-mounted by doing an Apple-K and selecting them from our Time Capsule. First, is it normal to lose shares after closing the MBP for a moment, as when carrying it from one room to another? If it's not then our router is just going, being beyond the age when they're supposed to expire. If it is normal, is there anything to help make them more robust and keep them mounted? MountWatcher didn't seem to do the trick.

    your network shares should stay mounted on your desktop, unless to specficially tell it to unmount after a certain time of inactivity or unless you loose connectivity.  I have 2 network shares that unmount after they expire idle time other than that they stay mounted

  • User Passwords Rejected on AFP share mounts?

    User Passwords Rejected on AFP share mounts?
    (OK, my last post got buried, and perhaps too long), try again. Very brief
    Issue:
    After so many days, a User's AFP share password is rejected? What gives.
    If you reset it, several days later, same thing, rejected.
    Is Netinfo Database corrupted, what can / should be done?
    - Stand Alone server (with AFP and FTP services running, all other services off, not running.
    Summary Info for user having issue:
    Location: 192.168.0.50/NetInfo/DefualtLocalNode
    Home: No Home Directory
    Primary Group: Users (20)
    Password: Shadow Password
    I have deleted that troublesome user name and created a new name (for that user), just in case, in the re-creation of the same user name (after deletion) some corruption gets inherited.
    thanks,
    macguitarman
    Power Mac G5 Dual 2.0   Mac OS X (10.4.7)  

    Using Tiger Server, I have found that enabling ACLs, or Access Control Lists on the volume, and then specifying users and/or groups into the specific ACLs for the share point has been very helpful. Also note that 10.4.10 server seems to work better than 10.4.11, so if you haven't upgraded, don't go beyond 10.4.10. .11 seems to have some permissions issues and other problems.
    I assume you are connecting to the server via AFS (i.e. Go > Connect to Server > ip address) and not SMB? SMB sometimes is more problematic about ownership. But either way, Mac or PC clients, it seems ACLs are the way to go.
    Crazy as it seems, on my server, even if the owner is, say, admin, and the group with r/w permissions is, say, Prepress, it helps to specifically add the Prepress group to the ACL for that share. Then be sure to propagate the permissions down (unless you don't want to, for some reason). To do this, click the little gear icon and propagate all the permissions -- owner, group, acl, etc. down. This will take a bit of time depending on how much stuff you have. I also find that a server reboot can be helpful.
    [[ All this said, 10.5.1 seems to do some crazy things, and I hope 10.5.2 addresses them. I have one machine (not user ID) that always creates a folder on a share with no permissions for anyone. Only from that Mac; the same login on another works just fine. Go figure]]

  • SL server share mounting not working for 10.7.4 Mac Mini

    I'm running about seven Macs on a network with a 10.6.8 Mac Mini server.
    The older Macs (PPCs and 10.4.11) mount the share immediately.
    Newer Macs recently have had a problem.
    My 10.6.8 MBP can mount the share, from a dock icon, but it can take minutes.
    Another Mac Mini (10.7.4) now refuses to mount the share manually. It can't make contact with the server share. I've tried via Ethernet and WiFi. It just hangs with Connect to Server.
    And yet, it has no problem with the iCal server running on the server.
    Another older MB and 10.6.8, mounts the share immediately.
    Has anyone had newer hardware with 10.7.4 develop server connection problems?

    Hi iToaster,
    These were all good tips, and I tried or investigated them.
    As it turns out, I noticed my SL Mac server needed a Java and securtiy update.
    After installing, mount time on my Lion and SL client Macs was near normal, not minutes. (Again, my older Macs had mounted the server share quickly and normally, when the newer ones did not.)
    My suspicion is that a modern OS sensed that the Java and security updates were not in place and took extra time to check the share mount in some manner.
    Thank you for your time, experitse and ideas, iToaster!

  • Keychain: Automatic share mounting

    Greetings!
    I want a specific share of my NAS to be mounted at the system startup. I mount it and enter the appropriate username and password and also put the tick to save to keychain option. Then I drag the icon of the share to the Login Items list at the Users pane of System Preferences and restart the system. After restart the system still asks me the username and password for the share.
    How can I properly setup Keychain to do the automatic share mounting?

    Mount the shared disk or folder you to access. Open System Preferences/Accounts/<yourname>/Login Items and click the '+' symbol. Click on the drop down menu at the top of the resulting window and go to the very top level of your Mac, in this case MacBook Computer. You should now have a window containing all the mounted volumes. Click on the triangle next to the share point you have mounted and select the folder you want to automount on startup and click Add.
    If this is a public shared folder then you should have no problems, if on the other hand it requires a username password in order access it then remember to add these to the keychain when you first mount it and before you add it to the login items

  • 10.8 Server - share mounted image

    Sharing a mounted image file like sparse bundle over AFP was not a problem in 10.6.x or 10.7.x.
    On 10.8.x Server the mounted image files are not available over AFP anymore only via CIFS/SMB.
    In 'File Sharing' section of Server.app the mounted image seems like being shared and I couldn't find any error in log.
    But when a client machine tries to connect over AFP this share point is not available, only over CIFS/SMB.
    I've found a workaround, but unfortunately it's not working:
    https://github.com/joshado/liberate-applefileserver
    Inability to share mounted images over AFP is an issue with 10.8 and 10.8 Server too.
    Anyone with a fix?

    10.8.2 Update and the Server.app version 2.1.1 is the fix!

  • NFS share mount on solaris 10 : error 48

    I got the below error when mount NFS share  on solaris 10  . Please help
    Oct 20 10:02:12 etravel2k nfs: [ID 182275 kern.warning] WARNING: NFS server initial call to scom01 failed: error 48

    Hi,
    try to force the mount with nfs version 3.
    # mount -o vers=3 server-name:/share-point /local-dir
    regards
    Walter

  • Temporary NFS mount keep being mounted while server is powered off

    I was doing some performance testing using different file protocols (NFS, SMB mainly).
    The last test was with NFS, I mounted on the command line the nfs exported directory, did my test, forgot about the moment and shutdown the NFS server. Since then OS X is bugging me every 2 minutes with a popup (which has the focus!) which states "There was a problem connecting to the server 192.168.1.250". The mount is not visible via 'df' so I decided to reboot the machine... But even after rebooting it, the popup keep on poping up!
    The setup was: OS X 10.8 as NFS client; FreeBSD 9.1 as NFS server (in a virtual machine hosted by a Linux machine on the same network). The command was:
    mount -t nfs 192.168.1.250:/mnt/test ~/mnt/
    I restarted the FreeBSD VM, suddenly the NFS export was mounted, this time as /Volumes/test. I unmounted it this time using:
    sudo umount /Volumes/test
    It did work successfully. I shutdown and deleted my VM, and some hours later the popup reappeared!!
    How to get rid of it? Or more explicitely where is the configuration file where the mount is still explicitely present?
    (it is not in /etc/fstab, nor /etc/auto_master) I did a huge grep using the IP address on the disk, and I got only log errors in /var/log.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    Third-party system modifications are a common cause of usability problems. By a “system modification,” I mean software that affects the operation of other software — potentially for the worse. The following procedure will help identify which such modifications you've installed. Don’t be alarmed by the complexity of these instructions — they’re easy to carry out and won’t change anything on your Mac. 
    These steps are to be taken while booted in “normal” mode, not in safe mode. If you’re now running in safe mode, reboot as usual before continuing. 
    Below are instructions to enter some UNIX shell commands. The commands are harmless, but they must be entered exactly as given in order to work. If you have doubts about the safety of the procedure suggested here, search this site for other discussions in which it’s been followed without any report of ill effects. 
    Some of the commands will line-wrap or scroll in your browser, but each one is really just a single line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, and you can then either copy or drag it. The headings “Step 1” and so on are not part of the commands. 
    Note: If you have more than one user account, Step 2 must be taken as an administrator. Ordinarily that would be the user created automatically when you booted the system for the first time. The other steps should be taken as the user who has the problem, if different. Most personal Macs have only one user, and in that case this paragraph doesn’t apply. 
    Launch the Terminal application in any of the following ways: 
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.) 
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens. 
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid. 
    When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign (“$”) or a percent sign (“%”). If you get the percent sign, enter “sh” and press return. You should then get a new line ending in a dollar sign. 
    Step 1 
    Triple-click the line of text below to select it:
    kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}' 
    Copy (command-C) the selected text to the Clipboard. Then click anywhere in the Terminal window and paste (command-V). Post the lines of output (if any) that appear below what you just entered. You can do that by copy-and-paste as well. Omit the final line ending in “$”. No typing is involved in this step.
    Step 2 
    Repeat with this line:
    sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix)|edu\.mit|org\.(amavis|apache|cups|isc|ntp|postfix|x)/{print $3}' 
    This time you'll be prompted for your login password, which you do have to type. It won't be displayed when you type it. Type it carefully and then press return. You may get a one-time warning not to screw up. You don't need to post the warning. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator. 
    Note: If you don’t have a login password, you’ll need to set one before taking this step. If that’s not possible, skip to the next step. 
    Step 3
    launchctl list | sed 1d | awk '!/0x|com\.apple|edu\.mit|org\.(x|openbsd)/{print $3}' 
    Step 4
    ls -1A /e*/mach* {,/}L*/{Ad,Compon,Ex,Fram,In,Keyb,La,Mail/Bu,P*P,Priv,Qu,Scripti,Servi,Spo,Sta}* L*/Fonts 2> /dev/null  
    Important: If you formerly synchronized with a MobileMe account, your me.com email address may appear in the output of the above command. If so, anonymize it before posting. 
    Step 5
    osascript -e 'tell application "System Events" to get name of every login item' 2> /dev/null 
    Remember, steps 1-5 are all copy-and-paste — no typing, except your password. Also remember to post the output. 
    You can then quit Terminal.

  • Global DFS share mounting ?

    is there a way to mount a set of DFS shares on Lion if bound to Active Directory, so if user_A or user_B can login and both would get the same pre-defined mapped drives.
    I know ADmitMac has ADmitMac Brower that you can define things like this (part of the package).  I am trying to see if there is a native way to do this with Lion without a third party application to drive it.
    Let me lay some history:
    I already know you can do an apple script  calling the mouse save the script as an APP then place it into Login Items under the user's account.  This works fine but if you have a large user base it tends to be tedicious.
    i don't want to do a launchd but would if it was the olnly way possible to accomplish this. 
    I've tried:  mkdir .... /folder_name_to_mount_on_desktop_DFS_share_name
                      mount_smbfs //network_info_to_DFS_share/DFS_share_name
    save the script  to /Library/Scripts, change ower to ROOT (sudo chown root ... and sudo chmod 700)
    binded the script to loginhook (sudo defaults write com.apple.loginwindow LoginHook /path/to/the/script/script_name.sh
    the above is not the correct syntax i was just giving a high level overview of what i've tried. If i open terminal and do the mkdir / mount_smbfs works ok but nothing goes for someone logging in and have it call up the script and mount the proper drivers.  i do see the folder on the desktop just seems to never make it past the attach the network settings to the folder.
    syntax I am using is:  mount_smbfs //user@server_path/data/DFS_Share_name /User/Logged_in_user_name/Desktop/DFS_Share_Name (folder name matches the DFS share name)
    So the script looks like this
    mkdir /Users/$USER/Desktop/DFS_Share1
    mount_smbfs //$[email protected]/data/DFS_Share1  /Users/$USER/Desktop/DFS_Share1
    any ideas or direction would be great.

    Hi,
    Please refer to the thread below:
    DFS share for software distribution SCCM
    https://social.technet.microsoft.com/Forums/en-US/23b67594-f936-48ae-8ceb-d80ca47cc0d1/dfs-share-for-software-distribution-sccm?forum=configmanagerosd
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Error mounting NFS share - mount.nfs: Operation not permitted

    I've got an NFS share on a FreeBSD server which I mount via fstab.
    It mounts automatically at boot and everything is fine.
    However, if I unmount it and try to mount it again I get:
    mount.nfs: Operation not permitted
    I have tried vers=3 and nfsvers=3 in fstab, but to no avail.
    rpcbind is allowed in /etc/hosts.allow.
    Does anyone have any ideas?
    fstab entry:
    server:/path/to/files /mnt/files nfs ro,hard,intr,nfsvers=3 0 0

    Tagging along, I have the same problem, although I have a different setup:
    - Server = Arch linux
    - Client1 = Debian Testing linux
    - Client2 = Arch linux
    On client1, I'm unable to mount all NFS-shares. 2 out of 3 mount ok and the third fails with this error (both through fstab and manually):
    # mount -a
    mount.nfs4: access denied by server while mounting (null)
    On Client2 I'm able to connect automatically and manually to all shares.
    Maybe it is Debian-related, but the debian user forums have not been of much help...
    THX for any input!
    Last edited by zenlord (2010-03-04 12:07:04)

  • Hidden shares/mount points

    Apologies for double-posting this, but I just realized this forum is more suited for this question.
    I'm having a very strange problem in Lion running on a Mac Mini. I'm using Automount Maker to mount 8 different network shares at login and 2 of them are exhibiting weird behavior. All the shares except those 2 show up in the Finder. When I look in /Volumes using the Finder, the 2 mount points are not visible, but if I use Terminal to ls /Volumes, the mount points are visible in the list in Terminal. I can cd to those mount points and navigate the files, so the shares are definitely mounted, just invisible to the Finder. As a result, some scripts that run on the computer that reference /Volumes/sharename are failing.
    I've tried changing the visibility of these mount points with "chflags hidden" but that didn't fix it.
    I tested mounting the share without using Automount Maker (just the normal Apple+K method) and the share still mounts invisible. This time however, when the Finder pops open to show me the share after mounting it, the icon for the share in the Finder is dimmed. I've never seen this behavior before.

    You dont need timbuktu to control OSX server screen sharing is now built in.
    The most secure way to do what you want it to use ssh tunneling. You dont need vpn. with ssh you could run screen sharing and apple filesharing through the ssh tunnel.
    By default remote login is enabled in osx server. Being a server if configured correctly it will have a static ip address.
    So configure your office networks router to forward tcp port 22 from the internet to the ip address of your server.
    Then you need an account on the server, maybe you are already the admin account.
    open your terminal the following commands will setup a tunnel for file sharing and screen sharing.
    screen sharing tunnel
    ssh user@server -L 5901:localhost:5900
    replace server with the actual public IP address of your office internet connection. replace user with the actual account name on the server.
    Once logged in open the screen sharing app and use a host name of localhost:5901
    for file sharing use
    ssh user@server -L 5548:localhost:548
    once logged in
    press command +K and in the server address use localhost:5548
    that is it.

  • Sony z1 keeps un-mounting ext. hard drives...

    hello..
    I have a very strange problem...
    I'm using a sony z1 as a deck to capture some hdv media... well, trying to...
    I have just one ext. lacie drive plugged into one firewire port, and the sony z1 plugged into another firewire port. Every time i turn the z1 on, it un-mounts the drive. I've tried every possible combination of firewire set-ups, and every possible combination of turning things on and off... eg- leaving the deck(z1) off whilst booting up the g5 is ok, but when i turn the z1 on the drive un-mounts... or having the z1 switched on before turning on the g5 results in the drive not mounting at all, but if i switch the z1 off, sure enough, the drive mounts.
    I've daisy-chained the z1 through the drive, same problem... i have litterally, tried everything... now, the strange thing is, i'm using the same z1, the same edit suite and the same ext. drive that i was using the other day... when i had no problems...
    I'm running on fcp v5.1.1 and have not installed any new software... there is a possiblity that one of the guys here might have done a software update that could have caused this, but i'm not sure.
    any ideas?
    many thanks in advance for your suggestions.
    J

    Hello David,
    i understand what you're saying, but having just one firewire drive and one camera/deck, surely isn't overloading the bus... we usually have 3 terabites of drives daisy-chained to our system, along with the dsr1500ap, and we never have any problems.
    I stripped down the system to just the one drive with the previously captured HDV media on it, and just the Z1 acting as the deck, so i might be able to solve it in a process of elimination.
    I just spoke to a work collegue, and it turns out that he updated QT from 7.1.2 to 7.1.3 yesterday afternoon, which is where i'm thinking the problem lies... as in QT receipts... but i thought that was an old issue now that we could have moved on from.
    But i'm really stumped... the drive un-mounts etc before opening FCP, so it's not the usual camera/deck recogition problem that you'd usually associate with QT receipts problems...
    J

  • Why does this big download keep saying mounting failed?

    I'm downloading the Windows 7 beta and it gets to about 550 mb and then it says mounting failed. I was kind of paying attention to it right when it did it and I'm pretty sure that the HDD started up then stopped then it said that but I'm not totally sure. Any ideas?

    All it is is an iso that you burn to a disc. From what I read, it works just fine using BootCamp. Besides, it's just downloading it, not running it so that is not the issue.

  • Keeping Ipod mounted

    Hi--I've recently switched from an Imac to a Powerbook, and my trusty Ipod is having trouble keeping up. I keep my music (as before) on a LaCie external drive, but because there is only one firewire port on the powerbook, I have to plug the drive in there, and attach the Ipod to the drive. When I plug the Ipod in, it correctly makes whatever updates it's supposed to, but after a couple of minutes it disappears from the source list and desktop (but continues to charge). In order to update it again, I have detach and reattach it. Any suggestions?

    I think if you were to put a check mark in the box marked "enable disk use" (it's in iPod options), that will prevent the iPod auto ejecting itself after transfer of music has finished. Then, if you want to make further updates, you can use the "file/update iPod" option in iTunes.
    Bear in mind, that whilst you have disk use enabled on the iPod, you will have to manually eject it before physically disconnecting it.

Maybe you are looking for