Created
July 13, 2021 10:38
-
-
Save bgrgicak/d39be1f0315be82d6b11266d78c65a79 to your computer and use it in GitHub Desktop.
WC Admin analytics import runner. Used to run https://gist.github.com/bgrgicak/de6c675c832276ae852cb3330f448e62 and restert it if ti fails.
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 | |
TOTAL=${1:-5} | |
echo "Import runner started" | |
while : | |
do | |
ACTIVE=$(ps -aux | grep import-wc-admin-orders.sh | grep -c -v grep) | |
echo "Active importers: $ACTIVE/$TOTAL" | |
if [ $ACTIVE -lt $TOTAL ] | |
then | |
echo "Starting new importer" | |
sh import-wc-admin-orders.sh & | |
fi | |
sleep 60 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment