Last active
August 29, 2015 14:18
-
-
Save kcha/c2373cb971c8c6156f83 to your computer and use it in GitHub Desktop.
Chunk jobs so that they don't all execute at the same time
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
N=4 # Chunk size | |
C=0 # Counter | |
for i in {1..12}; | |
do | |
# submitjob here... | |
echo $i | |
((C=C+1)) | |
if [[ `expr $C % $N` == 0 ]]; then | |
sleep 1s | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment