Run rule only once if *any* contents of a folder change?

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

Moderator: Mr_Noodle

After fighting with this for hours I am completely perplexed and can only guess (or hope) I'm overlooking something simple.

I am trying to have Hazel monitor a folder's contents and upon any additions or changes to the files and folders within (at any level) to perform a sync with Transmit (via applescript embedded within the Hazel rule.)

The issue I'm running into is that I need to have the sync rule run only once. The sync action within Transmit will account for any new, updated or deleted files when updating the server to match the local folder.

If within Hazel I only check the top-level folder for changes ('Date Last Modified is after Date Last Matched') the rule only runs when items are added or changed within the first level beneath the that top-level folder. Any additions or edits within sub-folders do not seem to affect the 'Date Modified' for the top-level folder.

If I add a 'Process Subfolders' rule then additions or edits at any level fire off Hazel but the Transmit sync operation is run as many times as there are updated files when only once is needed.

I'm guessing I can have Hazel run some sort of upload script on a one-for-one basis with each updated file but this won't account for deleted files (right?) and also means firing off the supporting application or process many, many times.

Thanks in advance for any insights or help with this. I'm losing it ;)
Clayton
 
Posts: 2
Joined: Fri Dec 02, 2011 5:32 pm

Short answer: you can't do this very well with Hazel 2.x. Hazel 3 (in beta now) should be able to do this. I suggest you check the beta forum for more info.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thank you. I've downloaded 3.0b11 and the new features look very handy. But after playing with the settings and reading through the thread I'm still not too clear how things should be setup to accomplish a remote sync.

Can the current beta only run a rule once if any of the sub-folders / files have been modified (including detection of deleted files)?

Thanks again,
Clayton
Clayton
 
Posts: 2
Joined: Fri Dec 02, 2011 5:32 pm

Please post this in the beta forum. Since it's not officially released yet, I want all 3.0 stuff to remain there.

Thanks.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

EDIT: Reread your post and the below is not what you were asking. Possibly interim folder. File changes occur, get copied to a move folder. When added to move folder, transmit script run on move folder?


i have not played around w 3.0 (which is crazy for me but i have no time these days). But i saw this and wanted to offer quick suggestion. I use color labels for this type of thing. Anytime you do something to a file color label it. Hazel will look for changes to a file. Lets say you have a folder A. Has files in it 1,2,3. Not sure how they are changing but if they are being replaced by downloaded files, you can just color code the downloads once they enter the folder. That can be the trigger to start a transmit session. Or if you are working in a program and constantly saving over those files, you could run a workflow that would:
1) Files modified in last 2 mins, color green
2) if color green, a) change back to no color label, b) copy via transmit session

Hazel will always match rule 1 until you go outside the 2 min window, then that rule will no longer match and 2 will match and it will kickoff.

Make sense?

Not sure your full workflow but hopeful that helps. If its more complex, let me know and ill try and help.
dhy8386
 
Posts: 96
Joined: Tue Nov 09, 2010 12:19 pm


Return to Support