Checking for existence of a watched folder

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Checking for existence of a watched folder Wed Dec 23, 2009 11:57 am • by JohnDCCIU
Is there any way for Hazel to react to the non-existence of a watched folder? For example, I'd like to have Hazel watch a folder on a mounted share and if the share becomes unmounted (because the hosting server rebooted or whatever), Hazel could detect that and I could run a script to re-mount the share.

If not, could it be considered for an feature in a future version?

Thanks!
JohnDCCIU
 
Posts: 15
Joined: Tue Jun 02, 2009 2:17 am

While I've thought about how to deal with deleted files and such, it's not how Hazel is structured now. There are a lot of edge cases that would need to be hammered out.

For a case like this, there might be a better way to do this. Maybe take a look at the automounter?
Mr_Noodle
Site Admin
 
Posts: 11881
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

The two previous utilities that I tried to use (and have used successfully in the past) don't seem to work well any more, at least not with SMB volumes, perhaps because of Leopard (they're fairly old utils). They are "MountWatcher" and "Keep It Up". They sorta' work, but not reliably (hangs, etc) and not with SMB volumes from all flavors of Windows Server (i.e. Win Server 2008 shares seem to be an issue for some reason).

The unix automounter is pretty obtuse stuff, and it's not even clear if it will keep something mounted after startup: it seems be more about boot/login time.

I did just find another utility today that looks pretty old but I'm testing now and seems to work like a charm. It's called "Reconnector".

The "utility sprawl" is kind of a pain to maintain, so it would be nice to have Hazel incorporate some of these features in the future. Not that Hazel should become the kitchen sink, so to speak, but I think it's a logical extension of a utility that acts on files appearing in places to have a feature that can assist unattended automation by reliably mounting (and keeping mounted) network shares. For those of us that use Hazel to do cross-server unattended automation, it would be useful.

Thanks!
JohnDCCIU
 
Posts: 15
Joined: Tue Jun 02, 2009 2:17 am

Well, you could have Hazel watch the /Volumes folder (it's normally hidden but in a file dialog, enter the slash (/) character and you can type in the path. You can then have Hazel then ignore whatever file/folder is being processed and have a script check if the mounted folder is there and if not, mount it. It's a bit odd in that Hazel will run the rule for each folder under /Volumes but if you set up the script correctly, it'll just do a check then bail out early.
Mr_Noodle
Site Admin
 
Posts: 11881
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support