Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

camelia

macrumors 6502a
Original poster
Apr 3, 2015
714
123
Mexico City
Hi

Looking for an app that checks if the contents of a directory have changed.
Not via Terminal except if there is not option

SHA256

Thanks
Camelia
 
This might be overkill for your undisclosed purpose / desired outcome, but Noodlesoft's Hazel allows you to monitor files and folders for changes and trigger actions when that happens.
 
What are you asking for?

Check for new files in a folder? Then, as @Puonti says.

Check for integrity of file content (against "bit-rot"). Then:
Howard Oakley's Dintch (half way down https://eclecticlight.co/dintch/) is a GUI app which creates SHA256 digests and adds them to each file as an extended attribute. And, of course, it can check for errors.
 
  • Like
Reactions: camelia
What are you asking for?

Check for new files in a folder? Then, as @Puonti says.

Check for integrity of file content (against "bit-rot"). Then:
Howard Oakley's Dintch (half way down https://eclecticlight.co/dintch/) is a GUI app which creates SHA256 digests and adds them to each file as an extended attribute. And, of course, it can check for errors.
Nop, Hash a folder and contents like this app I bought
But is not working as expected because Cannot Open File :mad:
I am not asking to this app to open a file, I wanted to hast it!
Maybe a Terminal command exporting as .cvs or .xml will do the job I need

Why do I need it?

I have a backup of my entire macOS and Contents using Carbon Copy Cloner (CCC)

I want to have a second HDD with all my important files AS a second backup verifying all my files were moved to the media without corruption.

Thanks
Camelia

01HashFile.png
 
Nop, Hash a folder and contents like this app I bought
But is not working as expected because Cannot Open File :mad:
I am not asking to this app to open a file, I wanted to hast it!
Maybe a Terminal command exporting as .cvs or .xml will do the job I need

Why do I need it?

I have a backup of my entire macOS and Contents using Carbon Copy Cloner (CCC)

I want to have a second HDD with all my important files AS a second backup verifying all my files were moved to the media without corruption.

Thanks
Camelia

View attachment 2243851

Even if that program did work, I'm not sure how it would help you in determining if an entire folder structure has changed.

Seems like you're looking for some single value that you can look at and know an entire folder hierarchy is unchanged. I could imagine crafting a recursive hashing algorithm (e.g. where a folder's hash is the hash of a concatenation of all the hashes of the contained files and folders.). But, I don't know of program that does hashes of anything other than individual files.
 
  • Like
Reactions: camelia
Hash a folder and contents like this app I bought
I suspect that a hash of a folder is not not meaningful as the folder contains metadata which would change when moved. More meaningful to hash each file. You can do this:

1) Use Dintch (as suggested in post #3) which keeps hashes for each file in extended attributes attached to each file. It also does checking the hashes. The extended attributes remain with the file when moved (even via iCloud) so it is ideal for your purpose. There is also a command line version Cintch.

2) Create your own script to calculate hashes in a separate file. I use:
!/bin/bash
# Create _sha256tree.txt with checksums for each file in tree
# Excludes file starting with . or ^
# Uses /tmp for temp files
# May fail with some chars in file names
# Check with shasum -c _sha256tree.txt
# Based on https://superuser.com/questions/458326/sha1sum-for-a-directory-of-directories
#
# Create two temp files
tsort=$(mktemp /tmp/shar256srt.XXXXXXXX)
tsh=$(mktemp /tmp/shar256sh.XXXXXXXX)
# Get sorted list of files excluding starting with . or ^
find . -type f \! -name ".*" \! -name "^*" \! -name "_sha*" | sort > $tsort
# Create script to shasum each file
awk '{print "shasum -a 256 \""$0"\""}' $tsort > $tsh
# Run scrip to create file with the shasum of each file
bash $tsh > _sha256tree.txt
# clean up
rm $tsort
rm $tsh
This creates a single file in the folder with the hashes for all the files (with a few exclusions) in the current folder and subfolders. The single file can then be used in a shasum -c command to check the files.

When you move/copy the folder, the check file moves with it.

I also have it in an Automator workflow called as a Quick Action.
 
  • Love
Reactions: camelia
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.