Page 1 of 1

SMB mount not permanet, could Hazel help

PostPosted: Tue Aug 30, 2016 4:09 pm
by speedy_99
Hi,

Hazel monitores a folder on a mounted SMB-Share on my Windows Server 2012. Hazel is installed on a MacMini that runs unattended. This is he primarily purpose of the MacMini. Only sometimes is used for other things.

The Hazel rules (rename, move) are working fine, if the mounts are active. But the mounted shares are not permanent like it's in Windows.
The mounting is done by a script, that is running as a program. The script is starting on user login.
I have to run the script again to mount again. But the MacMini is running unattended, so this is a problem.
The standby of the MacMini is deactivated by caffine.

Could Hazel "help" to mount permanent by a rule? Or is there a other way to stay connected like in Windows?

thx
Juergen

Re: SMB mount not permanet, could Hazel help

PostPosted: Wed Aug 31, 2016 11:58 am
by Mr_Noodle
I feel like there is a better solution you could do at the system level, but theoretically you could do it with Hazel. It's a bit experimental and possibly dangerous so make sure you have no other option.

Have Hazel monitor /. Create a rule to match the Volumes folder. Add another condition to that rule to check for the existence of the particular mount underneath it. It would look something like:
Code: Select all
    If (all) are met
        Name is "Volumes"
        If (none) are met for (all of its sub-files/folders)
            Name is <<whatever the mount point name is>>
    Do
        Run shellscript <<your script to mount>>

Since you are monitoring /, you have to be careful to set the rule up properly and probably not go hog wild and create other rules that can mess with stuff up there. Whatever you do, do not create a rule that uses the "Run rules on folder contents" action.

Re: SMB mount not permanet, could Hazel help

PostPosted: Wed Aug 31, 2016 1:51 pm
by speedy_99
Hey Mr_Noodle,

thanks for your solution.

I agree, it's risky if I forget the rule is activ.

I feel like there is a better solution you could do at the system level


I am mainly a Windows-User and so I googled a lot In the last days.
Do you think to edit "/etc/auto_master" "/etc/auto_shares" is the better solution?

Re: SMB mount not permanet, could Hazel help

PostPosted: Thu Sep 01, 2016 3:25 pm
by Mr_Noodle
Not sure the exact thing here but I believe OS X does have an automounter so searching around for that might be a good place to start.

Re: SMB mount not permanet, could Hazel help

PostPosted: Thu Sep 01, 2016 3:28 pm
by speedy_99
Thanks, I found a few workarounds and will test them.