Mr_Noodle wrote:Here's a basic sync rule. It looks complicated but that's because it's very complete.
The first thing you should know is that if you want to sync a folder and all its contents, you need to have Hazel monitor the folder containing that folder you want to sync. Then you create a rule to match the folder you want to sync. In the rule I've attached, it matches against a folder named "blah". Change that to suit your situation.
The rule then matches if (a) the folder itself has changed or (b) any of its subfiles has changed. As a result, this will do a sync every time anything is modified. If it's a big folder tree, you may want to add a condition to do it less frequently, like "Date matched is not in the last 10 minutes", so that it doesn't bog things down. Alternatively, you can sync on a schedule using the Current Time attribute and get rid of all the conditions relating to date modified.
sync.hazelrules
EDIT (8/14/12): The older version of the rule had an error in it. Re-download if you downloaded it before.
I downloaded this recipe and imported it as a rule for a folder called Videos. Inside the Videos Folder, I have a Movies folder. I changed blah to Movies and then pointed the Sync into section to point to the Videos folder on my Drobo that has a Movies folder inside that has most of the content from the source.
The Drobo folder has most of the files, but there are 4 new files in the original location.
I used terminal to touch one of the files that has not been copied and I started Hazel. Looking at the log, I see that it is processing:
2013-04-05 14:18:39.113 hazelworker[96621] Processing folder Videos
2013-04-05 14:18:41.150 hazelworker[96621] Movies: Rule Sync folder "Movies" matched.
But it has been running for 2 and a half hours. I see other entries in the Hazel log, but I do not see an end message for Videos.
And nothing has copied from the source to the destination.
I guess I don't understand why Sync is so complicated to set up. Shouldn't you just be able to specify the source folder and the destination folder and the Sync keyword should just keep the two folders in, well, sync?
EDIT: I rebooted and let it run and it seems to be working now. Please disregard.