Created
January 18, 2019 05:58
-
-
Save anroopak/084cc913d2c701c30c228314c0f01f06 to your computer and use it in GitHub Desktop.
Running Jobs in Parallel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Runs the run_job function in parallel | |
run_job() { | |
/path/to/script.ext <args(optional)> $1 > "logs/$1.log" 2>&1 | |
} | |
export -f run_job | |
# limits.txt file has the args for the run_job function. | |
# -j4 => run 4 threads at max in parallel | |
# --eta => print the eta of the jobs on the console | |
cat limits.txt | parallel -j4 --eta run_job {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment