Copy modified files into the right folder

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

Moderator: Mr_Noodle

Copy modified files into the right folder Mon Nov 18, 2013 12:20 pm • by vw-Hazel
As I am new to Hazel I am having some difficulty understanding how to copy modified files into the right sub-folder. I think I understand the requirement to have a separate rule to go into a folder and then run separate rule(s), but I cannot work out how to write a rule for Hazel to copy files modified in one sub-folder to the equivalent sub-folder.

Setup:

1. Folder A, with
2. Three sub-folders (pdfs, complete and sounds), and
3. if any files modified in sub-folders pdf and sounds, then
4. only the modified files should be copied, to
5. equivalent sub-folders in Folder B.

Screenshots:

Image
Image

It is with step 5 that I am having diffculty. Help would be greatly appreciately.
vw-Hazel
 
Posts: 18
Joined: Wed Nov 13, 2013 10:57 am

Are you trying to mirror one folder to another? If so, you can use the Sync action instead as described here: viewtopic.php?f=4&t=1593#p6500
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Copy modified files into the right folder Wed Nov 20, 2013 12:05 pm • by vw-Hazel
Yes it is.

But however I try to configure this sample rule I cannot get it to work. Nothing happens, nothing is copied etc.

Based on the setup described in my first post here are some screen shots:

Image
Image
Image

Here is what the log (in debug mode) states:

Code: Select all
2013-11-20 15:57:03.933 hazelworker[24572] DEBUG: sounds: Did not match any rules.
2013-11-20 15:57:03.933 hazelworker[24572] DEBUG: Writing out DB file: /Users/victor/Documents/Folder A
2013-11-20 15:57:03.960 hazelworker[24572] DEBUG: Directory /Users/victor/Documents/Folder A processed in 0.060033 seconds
2013-11-20 15:57:03.960 hazelworker[24572] DEBUG: Sending metrics to scheduler. Next scheduled run:
2013-11-20 15:57:03.961 hazelworker[24572] Done processing folder Folder A


I am obviously missing something, but since my knowledge is so basic and there are no detailed hands-on explanations I am at loss what to do (other than to spend several more hours trying to make it work).

Further help would be gratefully received.
vw-Hazel
 
Posts: 18
Joined: Wed Nov 13, 2013 10:57 am

Re: Copy modified files into the right folder Wed Nov 20, 2013 12:48 pm • by Mr_Noodle
If you want to sync folder A, then you need to monitor the folder containing folder A. Give that a shot.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thank you. With the change it now works.

Hopefully last question on this topic.

If I have the three folders under Folder_A (pdf, cds, complete) but do not want Hazel to monitor/synchronise one of them (e.g. cds) where would I put the rules in the following set of rules:

Image

And would they be:

1. Kind is a folder
2. Name is not cds?
vw-Hazel
 
Posts: 18
Joined: Wed Nov 13, 2013 10:57 am

If a file/folder in folder A gets deleted, do you want that to be reflected at the destination? If so, then that complicates things a lot. Otherwise, you can instead have Hazel monitor folder A (back to what you had before) and set up the rule to match every folder except the CD one.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thank you for the reply.

I do not wish to delete Folder_A.

How do I set up the rules to match every folder except the CD one?
vw-Hazel
 
Posts: 18
Joined: Wed Nov 13, 2013 10:57 am

Re: Copy modified files into the right folder Fri Nov 22, 2013 12:34 pm • by Mr_Noodle
It's not about about Folder A being deleted. It's about items in folder A being deleted and whether or not you want those deletions to be reflected at the sync destination.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Apologies for misunderstanding.

I will not wish items deleted in Folder_A to be reflected in the sync destination. Essentially I wish to synchronise files which are modified or newly added files (unlikely for the folders I have in mind) to delete them.
vw-Hazel
 
Posts: 18
Joined: Wed Nov 13, 2013 10:57 am

Read the sticky article on going in to subfolders. Then create another rule to copy modified files. In that copy action, there are options to copy over the folder structure. Using that, you should be able to copy specific items over while retaining their general folder structure.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Copy modified files into the right folder Wed Nov 27, 2013 11:43 am • by vw-Hazel
Thank you for the latest response.

I have no problem in implementing the rule to go into a sub-folder. It is the copy of only certain folders which I contain to be stuck on.

I have tried endless variations on the sets of commands none of which work (and hours and hours of time).

Here is one example:

Image
Image
Image
Image


I am obviously missing something fundamental or so simple. I am the most basic type of user, and generalised comments, with respect, such as 'create another rule to copy modified file. In that copy action, there are options to copy over the folder structure.' do not help if you do not understand the context of how the program operates.

This is not helped with the complete lack of keyboard shortcuts (almost unique even for piece of Apple software). Trying one variation after another to get it working and having use the mouse or a trackpad just adds to the time it takes and the frustration.

It would be very helpful to have the specific commands to make this work.
vw-Hazel
 
Posts: 18
Joined: Wed Nov 13, 2013 10:57 am

Can you describe how it isn't working? Is nothing happening or is the file not being copied to where you want? Are you using the preview and if so, do the files match there as you expect?
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

On the basis of the example above (to recap):

1. Folder A containing three further folders (sounds, pdf, complete)
2. Wishing to copy only pdf and complete folders (and their contents) and only those that have changed.

For the basis of the example I added files to the folders for pdf and complete.

None of the files contained in pdf and complete are copied even though there are no files in the destination folders. So preview shows Hazel going into the subfolders but nothing else

In preview there is shown:

Image
Image

The log file shows:

Code: Select all
2013-11-28 12:43:13.875 hazelworker[44744] DEBUG: Program is licensed.
2013-11-28 12:43:13.900 hazelworker[44744] DEBUG: Unexpected type for Mail download URL: (null)
2013-11-28 12:43:13.906 hazelworker[44744] DEBUG: Could not find entry for default_directory in Chrome preference file.
2013-11-28 12:43:14.217 hazelworker[44744] Processing folder Folder A (forced)
2013-11-28 12:43:14.217 hazelworker[44744] DEBUG: Initialized
2013-11-28 12:43:14.217 hazelworker[44744] DEBUG: Pausing to wait for things to settle down.
2013-11-28 12:43:16.307 hazelworker[44744] DEBUG: Processing directories: (
    "/Users/victor/Documents/Folder A"
)
2013-11-28 12:43:16.308 hazelworker[44744] DEBUG: About to process directory /Users/victor/Documents/Folder A
2013-11-28 12:43:16.311 hazelworker[44744] DEBUG: Received file event: {
    date = "2013-11-28 12:43:13 +0000";
    path = "<ComNoodlesoft_NoodlePathSet: 0x7f95804a11e0> - (\n    \"/Users/victor/Documents/Folder A\"\n)";
}
2013-11-28 12:43:16.314 hazelworker[44744] DEBUG: .DS_Store: File is hidden/invisible. Skipping.
2013-11-28 12:43:16.315 hazelworker[44744] complete: Rule Go into folders matched.
2013-11-28 12:43:16.315 hazelworker[44744] DEBUG: Manual run. Forcing actions to be executed.
2013-11-28 12:43:16.315 hazelworker[44744] DEBUG: Recursing into directory: /Users/victor/Documents/Folder A/complete
2013-11-28 12:43:16.396 hazelworker[44744] DEBUG: Dictionary.pdf: Did not match any rules.
2013-11-28 12:43:16.400 hazelworker[44744] DEBUG: Lesson 01.pdf: Did not match any rules.
2013-11-28 12:43:16.403 hazelworker[44744] DEBUG: Lesson 02.pdf: Did not match any rules.
2013-11-28 12:43:16.406 hazelworker[44744] DEBUG: Lesson 03.pdf: Did not match any rules.
2013-11-28 12:43:16.407 hazelworker[44744] pdf: Rule Go into folders matched.
2013-11-28 12:43:16.407 hazelworker[44744] DEBUG: Manual run. Forcing actions to be executed.
2013-11-28 12:43:16.407 hazelworker[44744] DEBUG: Recursing into directory: /Users/victor/Documents/Folder A/pdf
2013-11-28 12:43:16.410 hazelworker[44744] DEBUG: Dictionary.pdf: Did not match any rules.
2013-11-28 12:43:16.412 hazelworker[44744] DEBUG: Lesson 01.pdf: Did not match any rules.
2013-11-28 12:43:16.414 hazelworker[44744] DEBUG: Lesson 02.pdf: Did not match any rules.
2013-11-28 12:43:16.418 hazelworker[44744] DEBUG: Lesson 03.pdf: Did not match any rules.
2013-11-28 12:43:16.418 hazelworker[44744] sounds: Rule Go into folders matched.
2013-11-28 12:43:16.418 hazelworker[44744] DEBUG: Manual run. Forcing actions to be executed.
2013-11-28 12:43:16.419 hazelworker[44744] DEBUG: Recursing into directory: /Users/victor/Documents/Folder A/sounds
2013-11-28 12:43:16.419 hazelworker[44744] DEBUG: Writing out DB file: /Users/victor/Documents/Folder A
2013-11-28 12:43:16.450 hazelworker[44744] DEBUG: Directory /Users/victor/Documents/Folder A processed in 0.141695 seconds
2013-11-28 12:43:16.450 hazelworker[44744] DEBUG: Sending metrics to scheduler. Next scheduled run:
2013-11-28 12:43:16.452 hazelworker[44744] Done processing folder Folder A


A copy of the rules is here
vw-Hazel
 
Posts: 18
Joined: Wed Nov 13, 2013 10:57 am

Ah, actually, you probably do not need the first rule to go into subfolders. Try disabling it and looking at the preview again. Note that doing it this way, it will copy the whole folders every time.

The alternative is to keep the first rule as you have it and then create another rule to copy the PDF (or whatever files), making sure to set the option to copy the folder structure, as I described earlier.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I am sorry I just do not understand how

create another rule to copy the PDF (or whatever files), making sure to set the option to copy the folder structure, as I described earlier.


is different from

Image

Is your quote referring to a different command, a different feature, a different configuration? I am just a basic user and cannot work out how to deal with this other trying for another several hours trying endless variations in the vague hope to get it right (and after several hours not working it out).

And your response, with respect, says nothing about how I can only copy two of the three folders.

What is wrong with this rule specifically:

Image

?
vw-Hazel
 
Posts: 18
Joined: Wed Nov 13, 2013 10:57 am

Next

Return to Support