Created
January 29, 2015 17:11
-
-
Save redacted/26d95891f682ad31b0d7 to your computer and use it in GitHub Desktop.
Automating a processing pipeline
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 | |
get_insights() { python insights_lastNdays.py; } | |
build_reports() { python gen_weekly_plots.py; } | |
upload_reports() { python upload_all.py; } | |
# functions to call in order | |
declare -a functions=(get_insights build_reports upload_reports) | |
# make sure we are in the right directory for paths! | |
cd "$(cd -P -- "$(dirname -- "$0")" && pwd -P)" | |
# first, download the facebook report | |
for f in ${functions[@]}; do | |
echo $f; | |
$f 2>&1 /tmp/cron_work.log | |
while [ $? -ne 0 ]; do | |
echo "Retrying in 5m" | |
sleep 300; | |
$f 2>&1 /tmp/cron_work.log | |
done | |
sleep 10; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment