URLではなくファイル名ごとのようにaxelが再開することを確認したい場合は、ファイルに確定的な名前を使用する必要があります。
axel -o NAME_OF_EXISTING_FILE
ファイルが存在するかどうかを確認したい場合
if [ -f $FILE ]; then
echo "File $FILE exists."
# operation related to when file exists, aka skip download
else
echo "File $FILE does not exist."
# operation related to when file does not exists
fi
axelの場合、
1。そのファイルがローカルにない場合、または
2.部分的にダウンロードしている場合は、ダウンロードを開始します。
function custom_axel() {
local file_thingy="$1"
local url="$2"
if [ ! -e "$file_thingy" ]; then
echo "file not found, downloading: $file_thingy"
axel -avn8 "$url" -o "$file_thingy"
elif [ -e "${file_thingy}.st" ]; then
echo "found partial downloaf, resuming: $file_thingy"
axel -avn8 "$url" -o "$file_thingy"
else
echo "alteady have the file, skipped: $file_thingy"
fi
}
これは〜/.bashrcまたは/usr/bin/custom_axel.sh以降に入る可能性があります。
while read URL; do
name=$(basename "$URL") # but make sure it's valid.
custom_axel "$name" "$URL"
done < /my/list/of/files.txt