Does anybody know of a good deduplication script / tool that runs on every filesystem and can be used as a nightly cronjob?
#!/bin/ksh
typeset -A hashes
find . -type f -exec shasum -a 512 {} \; |
while read hash filename; do
if [[ -z ${hashes[$hash]} ]]; then
hashes[$hash]="$filename"
else
echo ln -f "'${hashes[$hash]}'" "'$filename'"
fi
done
Pipe to /bin/sh if you're happy with the results.see also jdupes fork of fdupes