Skip to content

Instantly share code, notes, and snippets.

@mshirdel
Created December 14, 2017 21:24
Show Gist options
  • Save mshirdel/70cc29cd2c6ced65ea3b89916a034a0e to your computer and use it in GitHub Desktop.
Save mshirdel/70cc29cd2c6ced65ea3b89916a034a0e to your computer and use it in GitHub Desktop.
#!/bin/bash
aria2c -j1 -i list -c --save-session output.log
has_error=`wc -l < output.log`
while [ $has_error -gt 0 ]
do
echo "still has $has_error errors, rerun aria2 to download ..."
aria2c -j1 -i list -c --save-session output.log
has_error=`wc -l < output.log`
sleep 10
done
### PS: one line solution, just loop 1000 times
### seq 1000 | parallel -j1 aria2c -i list.txt -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment