how to eject volume after processing subfolders

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

Moderator: Mr_Noodle

how to eject volume after processing subfolders Sat Nov 04, 2017 6:36 pm • by dpiro
Is there a way to run the same single action (i.e., eject FTP volume) following the conclusion of a "Run rules on folder contents" action?

I use Hazel to copy statements from an FTP folder provided by a broker to my Mac. The FTP folder has date-based subfolders, one for each business day, each subfolder holding multiple statements, one each for several accounts. I link the following rules to the FTP top folder:
1. Apply rules to subfolders: for kind is folder, Run rules on folder contents
2. Copy statements: based on selection criteria, copy certain PDFs from FTP folder to a folder on my Mac.

This process works without a hitch. Except, about 15-25 minutes following the conclusion of Hazel processing, my Mac crashes. I've determined the crash is related to the FTP connection, but I've been unable to solve it. So, I avoid the problem by manually ejecting the FTP immediately following the Hazel processing. But this requires monitoring the Console and manually ejecting the FTP volume. This is tedious and error prone.

How can I have Hazel automatically eject the FTP following the copy process? The actual eject is simply running AppleScript: tell application "Finder" activate eject "mylogin@myftp.com" end tell. But I can't figure out the conditions to trigger this action.

Ideas?
dpiro
 
Posts: 1
Joined: Tue Oct 23, 2012 10:52 pm

There's no good way to determine when Hazel is "finished" in this case. The only thing I can think of is to put some sort of status indicator on the files/folders that you can look for later.

That said, I think it's best to fix the crash. For unrelated, but important, reasons, I'd also see if you can get your broker to use something other than FTP, since it's very insecure. SFTP or secure WebDAV even would be better.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support