Problem moving folders

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

Moderator: Mr_Noodle

Problem moving folders Tue Jan 14, 2014 11:48 am • by markrich
I have just set up a new MacMini server with Hazel.
I have a folder shared across the network as 'Dropbox'.
I have a simple rule within Hazel pointing to it,

if date-added is not in the last 2 minutes
move to folder 'Inbox'

When those on the network drop individual files into the Dropbox they move.
When they drop a folder containing files into the Dropbox it does not.

Looking at the Hazel logs as I force the rule returns error 5000 which I understand is a permissions problem.

Question is, how do I overcome this? Is there any AppleScript or other code I can execute as part of the Hazel rule to resolve the problem?
markrich
 
Posts: 3
Joined: Tue Jan 14, 2014 11:30 am

Re: Problem moving folders Tue Jan 14, 2014 4:31 pm • by Mr_Noodle
Look at the permissions on the folder. Also, try moving the folder manually in Finder and see if it works (if it requires a password, then it won't work in Hazel).
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Problem moving folders Wed Jan 15, 2014 5:59 am • by markrich
As a solution, that doesn't help me.

I know there is a permissions problem. There is a 5000 error in the log, as I mentioned.
The folder will move from Finder without issue. I have tried this.

I was thinking I could run a bash script to change the permissions of any item in the Dropbox folder to 777 so I tried this. It worked and then, it failed. No obvious reason, but it returned the same error as before.

Surely someone has managed a Hazel rule to move a sub folder containing objects from one folder to another haven't they?
markrich
 
Posts: 3
Joined: Tue Jan 14, 2014 11:30 am

Re: Problem moving folders Wed Jan 15, 2014 11:01 am • by markrich
Okay. Almost there I think.

I have amended the rule to run an AppleScript ahead of moving the files/folders from the Dropbox folder to the correct location.

do shell script "chown -R user1 '/Users/user1/Shared Folders/Dropbox/.' && chmod -R 777 '/Users/user1/Shared Folders/Dropbox/.'" user name "user1" password "password1" with administrator privileges

This changes the permissions and allows the content to be moved. If there is a better way I would like to know, but this hack does the job.

However....

If I split this into two separate rules, one to set the permissions and one to move the files, as I want to do for a temporary shared file storage place, then the script runs but the auto-delete element of that folder never happens. I have set rule 1 to run if date added is not in the last 2 minutes and rule 2 (the delete rule) to happen every 30 minutes. Both rules are ticked and in the correct order within the Hazel window.
markrich
 
Posts: 3
Joined: Tue Jan 14, 2014 11:30 am

Re: Problem moving folders Thu Jan 16, 2014 4:26 pm • by Mr_Noodle
A file can only match one rule. You need to fix the conditions or reorder the rules to take that into account. I'm guessing that most files are older than 2 minutes such that it always matches that over the 30 minutes rule.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support