merge folder and then delete source contents

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

Moderator: Mr_Noodle

merge folder and then delete source contents Fri Jan 24, 2020 12:37 am • by united
So i have two folders with those folders I have folders and within those i have files.

desired:
-- takes folderA - source and merges it with folderB - destination (adding folder and files that are not in folderB - destination without deleting anything)
-- create folders that are in folderA - source that aren't in folderB - destination
-- then moves to trash folderA content upon success merge.

tried:
-- sync seems to take the contents of folderB - destination and removes the existing files seems more like a mirror sync rather than a merge sync

folderA - source
_________
-folderB1
-- file B1-3
-- file B2-4
-folderB2
-- file B2-3
-- file B2-4
-folderB3
-folderB4

folderB - destination
_________
-folderB1
-- file B1-1
-- file B2-2
-folderB2
-- file B2-1
-- file B2-2
-folderB3

Result:
folderA
_________
<empty>

-folderB1 - destination
-- file B1-1
-- file B2-2
-- file B1-3
-- file B2-4
-folderB2
-- file B2-1
-- file B2-2
-- file B2-3
-- file B2-4
-folderB3
-folderB4
united
 
Posts: 23
Joined: Wed Mar 14, 2012 3:48 pm

You can have Hazel just move stuff over. You can use the move option to throw it away if it already exists at the destination. You'll need to have Hazel go into subfolders (search the manual as there is a whole chapter on this).
Mr_Noodle
Site Admin
 
Posts: 8522
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: merge folder and then delete source contents Fri Jan 24, 2020 10:29 pm • by united
So with the move option hazel still looks at root level of the folder directory of the source folder if it finds the same folder in the destination folder it just uses one of the 3 options which of "rename the file", "replace the existing file" or "throw the file away". All of which aren't producing the right results of if a folder exists take the content of the source folder and move it to the destination folder if the destination folder has the contents of the source folder use one of the 3 options. If i use throw away, the source folder replaces the destination folder instead of taking the files that don't exist in the source folder and adding it to the destination folder. https://www.noodlesoft.com/kb/going-into-subfolders/

attached is the rule i have setup but the results are still not working.

Image

any help would be appreciated... in getting this merge working correctly.
united
 
Posts: 23
Joined: Wed Mar 14, 2012 3:48 pm

You want to have Hazel copy the files instead of the root folder, as that is not granular enough. You don't want to combine your "subfolder" rule with your move rule either. I should have mentioned this before, but there is the option to copy the folder structure, which you'll need when copying over the individual files.
Mr_Noodle
Site Admin
 
Posts: 8522
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

For those who might need it.

Overview

Image

Removes - Empty Folder
Image

Subfolders
Image

Move Items over
Image
united
 
Posts: 23
Joined: Wed Mar 14, 2012 3:48 pm


Return to Support