Page 1 of 1

Duplicating files even though "Do not copy if a duplicate"

PostPosted: Sat Sep 26, 2009 7:31 am
by superjunior
In my home folder I've set up some rules to check my Downloads folder. If modified after last matched then it runs an applescript and connects to my NAS server.

In my Downloads folder I have a bunch of rules. For example copying files ending with a certain suffix to my NAS. Copying folder names containing certain characters. After these I have a rule that goes into subfolders followed by more rules.

The rules before the rule with "Run rules on folder contents" keeps duplicating at random, even though i checked "Do not copy if a duplicate". Sometimes the log says "Duplicate. Not copying." sometimes it's apparently copying because since I find duplicates with -1, -2 added to the file or folder name. The rules after the rule with "Run rules on folder contents" doesn't behave like this.

I haven't changed the files in any way.

Is it because of colliding rules that runs the same files without me understanding or is perhaps a bug?
Can it be because of my NAS connecting and disconnecting?

Thanks.

Re: Duplicating files even though "Do not copy if a duplicate"

PostPosted: Mon Sep 28, 2009 9:48 am
by Mr_Noodle
Are you comfortable using the commandline? If so, I suggest using the 'diff' program to make sure the files are the same. Hazel will actually check the file contents to make sure they are the same.

The thing I don't understand is having the "Run rules on folder contents" doing the copying. My sense is that you are combining the logic for two different rules into one. See the sticky article near the top of this forum on subfolders. You may be copying folders instead of files in which case it's very easy to make folders not be the same (if you view it in Finder, for instance, you could change the invisible .DS_Store file inside it).

Re: Duplicating files even though "Do not copy if a duplicate"

PostPosted: Tue Sep 29, 2009 3:05 am
by superjunior
Update:
When i remove my rule about connecting to my NAS (which was triggered by any changes in my Download folder) the duplicating seems to have stopped. (Just to add info on the original problem: Hazel was also duplicating top level files, which had not been opened nor moved, not only folders. And it was the rules before the "Run rules on folder contents" that kept duplicating.)

You ask:
The thing I don't understand is having the "Run rules on folder contents" doing the copying.
I want some rules to copy the top folder, but i some cases go into folders, look for a .rar, open that file, then move the just unarchived file and not the top folder with all the rar-files. Makes any sense?

How about a new feature:
"Do not copy if a file name matches"? Maybe this is more common than files with same file name but data differences?

Question:
If a part of a rule is to copy or move to a folder on a server, and that server is not available at that time, will Hazel complete the task when the folder becomes available or will it just give up? If Hazel tries to complete the task, what will trigger it to retry? I guess it doesn't check availabilty of destination folders?

(Thanks for replying and for a great app!)

Re: Duplicating files even though "Do not copy if a duplicate"

PostPosted: Tue Sep 29, 2009 2:04 pm
by superjunior
Update 2:
I just manually connected to my NAS a few hours after some new files/folders were downloaded to my Downloads folder, to which copying/move rules applied. And Hazel did indeed complete the task when the destination folder became available! Great!

I have now set my connect script to a iCal schedule instead, I hope this will elude the duplication of files and folders.

Another Question. :)
Is it possible to copy a folder except certain files inside it? (or create a new folder at destination with parent folder's name and put a specific file(s) inside it?)

I heard a rumour about renaming based on parent folder, that could always get useful.
Performing tasks depending on the time of day, is that something for future versions of Hazel?

Re: Duplicating files even though "Do not copy if a duplicate"

PostPosted: Tue Sep 29, 2009 8:24 pm
by Mr_Noodle
You can't selectively copy files in a folder if copying the folder itself. You can tell Hazel to go into that folder and have rules copy those files individually. At the moment, you can't recreate the folder structure at the destination. That's something currently slated for a future release.

Filtering on time of day is also slated for a future release. If you find the thread about this, you can add your own requirements as to what you need out of the feature.

Re: Duplicating files even though "Do not copy if a duplicate"

PostPosted: Wed Sep 30, 2009 7:45 am
by sjk
Mr_Noodle wrote:Filtering on time of day is also slated for a future release. If you find the thread about this, you can add your own requirements as to what you need out of the feature.

It was discussed in (at least):

Pause folders?

Re: Duplicating files even though "Do not copy if a duplicate"

PostPosted: Tue Dec 15, 2009 5:53 pm
by superjunior
Some time has past since I posted this topic.

The duplication of files stopped when i removed a "kind" rule. Don't know why, but it worked.
Recently i tried to add a growl notification on my move and copy rules (to my NAS) and the duplication started again. Up til 3 duplicates per file before I removed the growl notification. Back to normal, no duplicates.

But now, a few days ago, Hazel started duplicating files again, for no apparent reason. No rules changes, nothing. It's the same files and folders that are getting duplicated, the ones matched by rules before my "Go into folders" rule.

And of course, the "Do no copy if a duplicate" is active.
Exactly what does the global setting "Throw away: Duplicate files" do? I didn't really get it even with the tool tip. Will it help me? If duplicate found at target volume, it won't copy or move?

Re: Duplicating files even though "Do not copy if a duplicate"

PostPosted: Tue Dec 15, 2009 5:59 pm
by Mr_Noodle
Maybe you should email your rules to me. It's hard to get a bead on what's going on without knowing your exact rule logic. Also, if possible, send in the logs showing a run where the files are getting duplicated. Just click the "Contact Support" link in the "Info" pane.