# get a list of urls and corresponding output file names, then parse them to wget
+LOGTAG="nameget.sh"
args=("$@")
list=${args[0]}
otherargs=$@ # set aside remaining arguments for passing to wget
+logger -s -t $LOGTAG "starting downloading files in $list"
+
while read -r url filename tail; do
- if wget --cut-dirs=100 -r -np -nc --accept -e robots=off -O "$outdir$filename" "$url" $otherargs
+ if wget --cut-dirs=100 -np --accept -e robots=off -O "$outdir$filename" "$url" $otherargs; then
sed '/$filename/d' $list
+ logger -s -t $LOGTAG "downloaded $filename"
+ else
+ logger -s -t $LOGTAG "downloading of $filename from $url failed."
fi
done < $list