Delete files from a folder that are NOT in another folder

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

Moderator: Mr_Noodle

I've searched, so if this info is already available please point me to it.

Want to compare 2 folders, remove the files from Folder A that are not in Folder B. (Name matching will be sufficient, but comparing contents is best.)

This is because Mac smart folders (searches) don't work with the syncing folders with delete technique found here https://www.noodlesoft.com/manual/hazel ... g-folders/

So I setup a 1-way sync from the smart folder to destination, which does a good job of adding to the destination.

I want to setup a separate rule that will check the "destination" folder for any files that are not in the "source" folder (smart folder) and delete them from the destination.

Thanks for the help. Hazel is really a great tool!
BenW
 
Posts: 1
Joined: Tue Mar 10, 2020 7:52 pm

You may need to come up with a script to do that type of logic. Either that, or have rules at the destination that mimic what the Smart Folder filters on, removing whatever doesn't match those filters.
Mr_Noodle
Site Admin
 
Posts: 8523
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support