Advertisement
funcelot

run wget in parallel

Mar 2nd, 2021
1,226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.50 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. ## The time (in minutes) the script will run for. Change 10
  4. ## to whatever you want.
  5. end=$(date -d "10 minutes" +%s);
  6.  
  7. ## Run until the desired time has passed.
  8. while [ $(date +%s) -lt "$end" ]; do
  9.     ## Launch a new wget process if there are
  10.     ## less than 70 running. This assumes there
  11.     ## are no other active wget processes.
  12.     if [ $(pgrep -c wget) -lt 70 ]; then
  13.         wget http://www.betaservice.domain.host.com/web/hasChanged?ver=0 2>/dev/null &
  14.     fi
  15. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement