Merge two folders with same subfolder structure

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

Moderator: Mr_Noodle

If you have 2 different folders containing subfolders of identical name (see example below) - is it possible to use Hazel to merge the top folders and all subfolders without accidentally overwriting any files? I have two top folders with hundreds of subfiles and dozens of folders. But instead of merging each subfolder manually, Id like to write a few rules that will merge all of the subfolders. For instance (merge subfolder FINANCES and all contents in Records1 with FINANCES in Records2) ...and in case there are any duplicates, Id rather have them renamed than overwritten.

ie...

Records1
- Finances
- Auto
- Insurance
- (20 other subfolders)

Records2
- Finances
- Auto
- Insurance
- (20 other subfolders)
noodlepie
 
Posts: 8
Joined: Tue Aug 12, 2014 1:15 pm

First off, read the sticky article at the top of this forum about going into subfolders.

Next, create a rule to do the copy. For the copy there is an option to copy over the folder structure as well. Set that to copy over the structure from the monitored folder. I think that should do what you want.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

im having some trouble implement this.

What is the appropriate structure for the following action:

If a folder is tagged RECORDS2, move all of its contents to RECORDS, keeping the folder structure, without overwriting any of the folder contents.

The trouble Im running into is

Source folder called RECORDS2 > HEALTH containing 5 files
Destination folder called RECORDS > HEALTH containing 10 files
hazel sees that the folders have different contents so it creates a new folder is created called RECORDS > HEALTH1.

The desired result is that RECORDS > HEALTH would not rename the subfolder if it has different contents, but the folders would be merged. If there are duplicate files within a subfolder, the files themselves would be renamed, but the subfolders of the same name would merge.
noodlepie
 
Posts: 8
Joined: Tue Aug 12, 2014 1:15 pm

Can't say without seeing the rule but I suspect you are matching the folder and copying it instead of the files within. You want to match the individual files. In the move/copy options, you then specify that you want to carry over the folder structure and that you want the files renamed if they already exist.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support