Last active
March 29, 2020 21:43
-
-
Save rjurney/0003cab7dc6980c724265b6244aaa87a to your computer and use it in GitHub Desktop.
How to occupy 64 cores with bzip2 validating files if you're a MORON :)
This file contains 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
#!/bin/bash | |
for year in 2017 2018 2019 2020 | |
do | |
for months in 01_02 03_04 05_06 07_08 09_10 11_12 | |
do | |
month1=$(echo "${months}" | cut -d '_' -f1) | |
month2=$(echo "${months}" | cut -d '_' -f2) | |
# 30 days x 2 is around 64 pids | |
for month in ${month1} ${month2} | |
do | |
echo "Doing month ${year}-${month} ..." | |
for day in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
do | |
# Now do all the files in that day group in the background | |
bzip2 -t ./${year}-${month}-${day}*.json.bz2 2>&1 | egrep '^bzip2' >> ${PROJECT_ROOT}/logs/github_validate.log & | |
done | |
done | |
# Perform some redundant work to slow things down | |
bzip2 -t ./${year}-${month}-28*.json.bz2 2>&1 | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment