bidirectional sync files by name

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

Moderator: Mr_Noodle

bidirectional sync files by name Fri Dec 27, 2013 6:51 pm • by photonator
I have a rather odd need for Hazel, and haven't quite figured out a fully working solution. I'm working with the following directory structure:

FolderA:
|- FolderB:
| | BarTag.txt
| | BazTag.txt
| Foo.txt
| BarTag.txt
| BazTag.txt

The aim is to have only files with "Tag" somewhere in their name be the same in both A and B, while keeping any file without the tag out of B. I've set up complimentary rules for A and B as: If (all) - (name) (contains) {Tag} and (Date Last Modified) (is after) (Date Last Matched) then (Sync) in to folder (FolderA)/(FolderB) respectively.

With some brief testing I found this solution to work with one exception: it wont remove files from its synced directory if it is deleted from its own. So, files accumulate and sync, but if one is deleted it remains in the other directory.

Is there some rule that compares the existence of items against last scanned? Or some other trick to get this working?
photonator
 
Posts: 2
Joined: Fri Dec 27, 2013 6:35 pm

Re: bidirectional sync files by name Fri Dec 27, 2013 7:22 pm • by photonator
Looks like I also need to know how to preserve mod dates when syncing.
photonator
 
Posts: 2
Joined: Fri Dec 27, 2013 6:35 pm

Re: bidirectional sync files by name Mon Dec 30, 2013 4:52 pm • by Mr_Noodle
I believe it should preserve the modification date when syncing. That said, you can't really use sync for this. The problem is that you need to sync Folder A (not the contents of A which is what you are doing now). You can't sync Folder A but have it selectively not sync Folder B underneath it. If folder B were elsewhere, then syncing would work, once you adjust it to monitor one level up and match Folder A instead of its contents.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support