From e03def014d29c8597a50e995c0f1ff1caed26c38 Mon Sep 17 00:00:00 2001 From: Justin Emter Date: Mon, 11 Sep 2017 17:01:10 -0700 Subject: [PATCH] Updated the generate-channels-daily-schedule.sh script. --- .../generate-channels-daily-schedules.sh | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/multi-channel-bash-scripts/generate-channels-daily-schedules.sh b/multi-channel-bash-scripts/generate-channels-daily-schedules.sh index 401143f..3f8b724 100644 --- a/multi-channel-bash-scripts/generate-channels-daily-schedules.sh +++ b/multi-channel-bash-scripts/generate-channels-daily-schedules.sh @@ -32,9 +32,9 @@ if [ -d "$VIRTUAL_ENV_DIR" ]; then PYTHON_TO_USE="$VIRTUAL_ENV_DIR/bin/python" -fi + echo "+++++ Virtualenv found, using: $VIRTUAL_ENV_DIR/bin/python" -# If the file exists b +fi # Scan the dir to see how many channels there are, store them in an arr. CHANNEL_DIR_ARR=( $(find . -maxdepth 1 -type d -name '*'"$CHANNEL_DIR_INCREMENT_SYMBOL"'[[:digit:]]' -printf "%P\n") ) @@ -43,21 +43,20 @@ CHANNEL_DIR_ARR=( $(find . -maxdepth 1 -type d -name '*'"$CHANNEL_DIR_INCREMENT_ # then loop through each channel and run the updates if [ "${#CHANNEL_DIR_ARR[@]}" -gt 1 ]; then - # If virtualenv specified & exists, using that version of python instead. - if [ -d ./"$channel"/"$VIRTUAL_ENV_DIR" ]; then - - PYTHON_TO_USE=./"$channel"/"$VIRTUAL_ENV_DIR/bin/python" - - fi - echo "+++++ There are ${#CHANNEL_DIR_ARR[@]} channels detected." for channel in "${CHANNEL_DIR_ARR[@]}" do echo "+++++ Trying to update: ""$PYTHON_TO_USE" ./"$channel"/$SCRIPT_TO_EXECUTE_PLUS_ARGS - # If the running.pid file doesn't exists, create it, start PseudoChannel.py and add the PID to it. - "$PYTHON_TO_USE" ./"$channel"/$SCRIPT_TO_EXECUTE_PLUS_ARGS + + cd "$channel" && "./generate_daily_sched.sh" + + echo "+++++ Updated: $channel" + + sleep 1 + + cd ../ sleep 1