Advertisement
Guest User

Untitled

a guest
Oct 10th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. cd ~/Downloads/auto/
  4. echo "============================" >> log.txt
  5. echo "[$(date)] script launched" >> log.txt
  6.  
  7. echo "[$(date)] renewing dllist.txt" >> log.txt
  8. rm dllist.txt
  9. wget --user=folani --password=passwordesh melmi.ir/downloads/dllist.txt
  10.  
  11. echo "[$(date)] creating active.txt" >> log.txt
  12. comm dllist.txt done.txt -23 --nocheck-order > active.txt
  13.  
  14. while [ -s active.txt ]
  15. do
  16. echo "[$(date)] starting download" >> log.txt
  17. head -n 1 active.txt >> log.txt
  18. head -n 1 active.txt | sed -e's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g' | xargs echo -e | xargs -I {} wget -c "{}"
  19. echo "[$(date)] finished" >> log.txt
  20. head -n 1 active.txt >> done.txt
  21. tail -n +2 active.txt > tmp.txt
  22. mv tmp.txt active.txt
  23. done
  24.  
  25. echo "[$(date)] script finished." >> log.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement