PROJECT - Shared Community Tool - Directory Comparison and file purge/reclaim

I raise this as a possible focal point for encouraging Community participation, communication and shared benefit! :slight_smile:

Also note, I use rsync as my primary tool for storing offline backups onto a USB hard drive, and the below is not intended to emulate that directly. Instead, it is trying to consolidate two near-identical trees in an intelligent fashion.


The below script has been evolving over the last 7 years. I would call it a "Work-in-Progress" except that people regard such a description as equivalent to "Half-Baked".

I can assure you that it is not Half-Baked!

For me, WIP simply reflects that the tool has much more potential to evolve and grow its capabilities. Specifically,

  • diving down to deepest directory depths, first, before purging at those lower depths, then stepping one level higher up and repeating the purging process at that level, until reaching the top of the tree specified for the "Compare and Purge" process;

  • add logic to look for match on stat report (there is some minor use of this already) using 1) date, 2) file size and 3) file type ... to locate possibly renamed file containing identical coding;         or

  • trying to identify and handle directories whose position in the tree has shifted between the two versions compared.

So I offer up my Bash script, with all its "worts" for the Community to review, try, and hopefully contribute step-wise in advancing the tools functionality. Enjoy!

P.S. I don't know anything about a shared development environment within the GitHub context. I only use it as a repository to share. :slight_smile:


2 Likes