Add the progress log of sync

This commit is contained in:
Shiming Zhang 2021-09-16 15:47:53 +08:00
parent f53511e81a
commit 2161908397
1 changed files with 6 additions and 2 deletions

View File

@ -46,7 +46,10 @@ done
LOGFILE="./check-image.log"
echo >"${LOGFILE}"
for line in $(cat ./mirror.txt | shuf); do
count=0
images="$(cat ./mirror.txt | tr -d ' ' | grep -v -E '^$' | grep -v -E '^#' | shuf)"
images_count=$(echo "${images}" | wc -l | tr -d ' ')
for line in ${images}; do
line="${line/ /}"
if [[ "$line" == "" ]]; then
continue
@ -62,7 +65,8 @@ for line in $(cat ./mirror.txt | shuf); do
domain="${line%%/*}"
new_image=$(echo "${line}" | sed "s/^${domain}/${DOMAIN_MAP["${domain}"]}/g")
echo "Diff image ${line} ${new_image}"
count=$((count + 1))
echo "Diff ${count}/${images_count} image ${line} ${new_image}"
DEBUG="${DEBUG}" QUICKLY="${QUICKLY}" INCREMENTAL="${INCREMENTAL}" PARALLET="${PARALLET}" EXCLUDED="${exclude}" ./scripts/diff-image.sh "${line}" "${new_image}" 2>&1 | tee -a "${LOGFILE}" || {
echo "Error: diff image ${line} ${new_image}"
}