Benches macOS

10

Keeping Mounted volumes "alive"

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hi Folks,

Not sure if this is the right place to post this question (and it's my first time here so please be gentle with me :o)).. but..

I've got a Mac Mini being used as a media centre, which is connected to a NAS where the iTunes library is held. The device is mounted automagically upon startup and it works just fine.

However, after a certain amount of time of inactivity (a few hours maybe) the mounted device becomes unavailable.

Is there a known script / method whereby something is run say, every x minutes, that keeps the mounted device available ?

Cheers

Tim

10 replies

Sign in or join Beachball Help to reply.

  1. 0

    K T

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi Tim & welcome to the forums...

    Is the mini configured to sleep in any fashion?

    Because....a NAS that goes unavailable after a while isn't much of a NAS...

  2. 0

    TimHart

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    eesshh. I've just noticed I've posted this in completely the wrong place.. and I've no idea how to move it, so apologies in advance ! :o)

  3. 0

    K T

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Where do you want it?

  4. 0

    TimHart

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    hi K T - nope.. it's not set to sleep. the NAS in question is a Time Capsule, if that makes any difference

    Cheers

    Tim

  5. 0

    K T

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I've found that when iTunes is set to share a library and/or connect to one, it keeps the computer from sleeping. Any chance you're working with an alias?

    You want this moved to the TM forum instead?

  6. 0

    TimHart

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    .. also.. it's not the TC that makes itself unavailable.. It's still there (and available to all the network).. it's almost as if the mac mini has decided that if there's no activity then the device needs to be (re) mounted..

  7. 0

    K T

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Try creating an alias that sits on the mini and then connect iTunes to that location.

  8. 0

    TimHart

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thanks KT,

    I actually don't have an issue with the mini from not sleeping.. it's just behaving as if it wants to disconnect the mounted device after a while of non-use. I use an alias in the startup to mount the volume and both the alias icon and the mounted volume icon are still there after x hours.. it's just that I have to re-mount it after a certain amount of time

    and yes please - if you can move this thread that would be great - thanks :o)

  9. 0

    TimHart

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    .. iTunes is connected top the alias, also :o)

  10. 0

    TimHart

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thanks for your help so far KT .. I've now found the answers I've been looking for.. use of a crontab entry to run a script..

    and if anyone else is in need.. the full article can be found here :o)

    http://blog.davenicoll.com/2009/01/23/how-to-store-your-music-on-a-nas-or-networ k-share-and-access-it-with-itunes-on-a-mac/

    ...

    Creating a crontab entry to keep the network share mounted

    In a nutshell, a crontab is a set of commands which can be run at set intervals – perfect for refreshing our mounted network share, and especially handy for mounting the drive shortly after you’ve logged in or woken your Mac from sleep. Editing the crontab isn’t difficult but it can be fiddly. I use a great little utility called CronniX which I’ll be using for this tutorial.

    Now the thing is with cron is that when it does something, it likes to send you an email about it. And left unchecked, it can create a whopping great big mail file. And we don’t want that, do we! In CronniX go the Edit menu, and click Env. Variables. – add a new environment variable “MAILTO” (sans quotes). For the MAILTO value, type double quotes (“”).

    I run the mount command (above) every 10 minutes. If the network share has already been mounted, that’s fine, otherwise it’ll mount it again. If there’s no network share to mount – maybe you’re at work or school – it’ll fail silently. Using CronniX, create the following entries -

    Min Hour Mday Month Wday Command

    0 * * * * ~/Library/Scripts/MountMusic.command

    10 * * * * ~/Library/Scripts/MountMusic.command

    20 * * * * ~/Library/Scripts/MountMusic.command

    30 * * * * ~/Library/Scripts/MountMusic.command

    40 * * * * ~/Library/Scripts/MountMusic.command

    50 * * * * ~/Library/Scripts/MountMusic.command

    So you’ve created 6 entries, set to run at 0, 10, 20, 30, 40 and 50 minutes past the hour, and it’ll be running your mount command. Once you’ve done that, click Save in the main CronniX window.

    Chances are you still have the Music disk mounted on your desktop from before – right click on it, and Eject it (or drag it onto the recycle bin). If you wait until your clock shows 0, 10, 20, 30, 40 or 50 minutes (i.e. 10:40), a few seconds later the Music disk should reappear on your desktop – if it does, move on…