todo marker + log is path independend
This commit is contained in:
parent
5e16e006e6
commit
74217e16bf
12
cp_sh
12
cp_sh
@ -19,8 +19,8 @@ cat "$md5_tmp" | while read line; do
|
|||||||
file_orig="$(echo $line | cut -c 33- | sed -r -e "s/^[\ ]//g")"
|
file_orig="$(echo $line | cut -c 33- | sed -r -e "s/^[\ ]//g")"
|
||||||
file_size=$(du "$file_orig" | cut -f 1)
|
file_size=$(du "$file_orig" | cut -f 1)
|
||||||
file_md5=$(echo $line | cut -c -32)
|
file_md5=$(echo $line | cut -c -32)
|
||||||
file_aim_dir=$(echo $file_orig | rev | cut -d '/' -f 2- | rev | sed 's/data\/Filme/mnt\/export\/transport/g')
|
file_aim_dir=$(echo $file_orig | rev | cut -d '/' -f 2- | rev | sed 's/data\/Filme/mnt\/export\/transport/g') #prepare destination - not automated jet
|
||||||
file_aim=$(echo $file_orig | sed 's/data\/Filme/mnt\/export\/transport/g')
|
file_aim=$(echo $file_orig | sed 's/data\/Filme/mnt\/export\/transport/g') #prepare destination - not automated jet
|
||||||
|
|
||||||
[ "$file_orig" == "$file_aim" ] && { echo Script ERROR; exit 255; }
|
[ "$file_orig" == "$file_aim" ] && { echo Script ERROR; exit 255; }
|
||||||
|
|
||||||
@ -38,19 +38,19 @@ cat "$md5_tmp" | while read line; do
|
|||||||
file_md5_new=$(cat "$file_orig" | tee "$file_aim" | md5sum | cut -c -32)
|
file_md5_new=$(cat "$file_orig" | tee "$file_aim" | md5sum | cut -c -32)
|
||||||
|
|
||||||
if [ "${file_md5_new}" == "${file_md5}" ]; then
|
if [ "${file_md5_new}" == "${file_md5}" ]; then
|
||||||
echo "$file_md5 $file_aim" >> /mnt/export/md5.txt
|
echo "$file_md5 $file_aim" >> "${md5}.sucess-log"
|
||||||
sed -i "/$file_md5/d" "$md5"
|
sed -i "/$file_md5/d" "$md5"
|
||||||
else
|
else
|
||||||
echo "Error: Hash mismatch: \"NEW:${file_md5_new} OLD:${file_md5}\" $file_aim"
|
echo "Error: Hash mismatch: \"NEW:${file_md5_new} OLD:${file_md5}\" $file_aim" | tee "${md5}.error-log"
|
||||||
sed -i "/$file_md5/d" "$md5"
|
sed -i "/$file_md5/d" "$md5"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "To Big: $file_md5 $file_orig"
|
echo "To Big: $file_md5 $file_orig" | tee "${md5}.error-log"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Error: Not Exist: $file_orig"
|
echo "Error: Not Exist: $file_orig" | tee "${md5}.error-log"
|
||||||
sed -i "/$file_md5/d" "$md5"
|
sed -i "/$file_md5/d" "$md5"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user