Skip to content

Commit

Permalink
Allow resuming of interrupted downloads if databases and createtaxdb
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Jun 11, 2024
1 parent 25fc210 commit 0b27c9d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
15 changes: 12 additions & 3 deletions data/workflow/createtaxdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,22 @@ downloadFile() {
ARIA)
FILENAME=$(basename "${OUTPUT}")
DIR=$(dirname "${OUTPUT}")
aria2c --max-connection-per-server="$ARIA_NUM_CONN" --allow-overwrite=true -o "$FILENAME" -d "$DIR" "$URL" && return 0
if aria2c -c --max-connection-per-server="$ARIA_NUM_CONN" --allow-overwrite=true -o "${FILENAME}.aria2" -d "$DIR" "$URL"; then
mv -f -- "${OUTPUT}.aria2" "${OUTPUT}"
return 0
fi
;;
CURL)
curl -o "$OUTPUT" "$URL" && return 0
if curl -L -C - -o "${OUTPUT}.curl" "$URL"; then
mv -f -- "${OUTPUT}.curl" "${OUTPUT}"
return 0
fi
;;
WGET)
wget -O "$OUTPUT" "$URL" && return 0
if wget -O "${OUTPUT}.wget" -c "$URL"; then
mv -f -- "${OUTPUT}.wget" "${OUTPUT}"
return 0
fi
;;
esac
done
Expand Down
15 changes: 12 additions & 3 deletions data/workflow/databases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,22 @@ downloadFile() {
ARIA)
FILENAME=$(basename "${OUTPUT}")
DIR=$(dirname "${OUTPUT}")
aria2c --max-connection-per-server="$ARIA_NUM_CONN" --allow-overwrite=true -o "$FILENAME" -d "$DIR" "$URL" && return 0
if aria2c -c --max-connection-per-server="$ARIA_NUM_CONN" --allow-overwrite=true -o "${FILENAME}.aria2" -d "$DIR" "$URL"; then
mv -f -- "${OUTPUT}.aria2" "${OUTPUT}"
return 0
fi
;;
CURL)
curl -L -o "$OUTPUT" "$URL" && return 0
if curl -L -C - -o "${OUTPUT}.curl" "$URL"; then
mv -f -- "${OUTPUT}.curl" "${OUTPUT}"
return 0
fi
;;
WGET)
wget -O "$OUTPUT" "$URL" && return 0
if wget -O "${OUTPUT}.wget" -c "$URL"; then
mv -f -- "${OUTPUT}.wget" "${OUTPUT}"
return 0
fi
;;
esac
done
Expand Down

0 comments on commit 0b27c9d

Please sign in to comment.