You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

parallel_jobs_example.sh 767B

123456789101112131415161718192021222324252627282930313233343536
  1. #! /usr/bin/env bash
  2. # first element to process, inclusive
  3. first=1
  4. # last element to process, inclusive
  5. last=2259
  6. # number of parallel instances to launch
  7. threads=100
  8. # max number of element to process per parallel instance, optional (automatically computed, all items processed at once)
  9. #parallelNbItems=10
  10. preLaunch()
  11. {
  12. echo "Removing old data..."
  13. sleep $((${RANDOM} % 10))
  14. }
  15. postLaunch()
  16. {
  17. echo "Processing all data..."
  18. sleep $((${RANDOM} % 10))
  19. }
  20. launchInstance()
  21. {
  22. local instanceBegin=${1}
  23. local instanceEnd=${2}
  24. local instanceCount=${3}
  25. local threadNumber=${4}
  26. local instanceNumber=${5}
  27. sleep $((${RANDOM} % 10))
  28. }
  29. #==============================================================================
  30. . ./parallel_jobs.sh