keep most recent version, not oldest (less redownloading)

This commit is contained in:
Alexander Bocken 2021-08-15 15:50:32 +02:00
parent 06befea402
commit a67fb19269
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8

View File

@ -207,7 +207,7 @@ dedupe(){
fi fi
echo "$dirs" | while read -r dir; do echo "$dirs" | while read -r dir; do
echo "Generating checksums for $dir ..." echo "Generating checksums for $dir ..."
duplicates="$( sha512sum "$dir"/* | sort | awk 'seen[$1]++' )" duplicates="$( sha512sum "$dir"/* | sort -r | awk 'seen[$1]++' )"
if [ -n "$duplicates" ]; then if [ -n "$duplicates" ]; then
echo "Deleting duplicates..." echo "Deleting duplicates..."
echo "$duplicates" | cut -d' ' -f1,2 --complement | echo "$duplicates" | cut -d' ' -f1,2 --complement |