User Tools

Site Tools


linux:system:disk:compare

Compare and check backups

Hash of directory tree

find dir/* -type f -print0 | sort -z | xargs -0 sha1sum | sha1sum; 

MD5 compare of two directory trees

# Set locale for proper sort order
export LC_ALL=C
for i in `ls $SRC`; do
	if echo "$EXCLUDE_COMP" | grep -q "$i";
	   then
	     echo "Skipping excluded: $i" 
        else
	     echo "Compare: $i"
	     { hashdeep -c MD5 -rb $SRC/$i | sed 1,5d | sort | md5sum;} &
	     { hashdeep -c MD5 -rb $DST/$i | sed 1,5d | sort | md5sum;} &
	     wait
	fi	
done
linux/system/disk/compare.txt · Last modified: by 127.0.0.1