Created
May 8, 2016 11:32
-
-
Save srgrn/ff5c08a2cebe7ff8e280aff6511d6310 to your computer and use it in GitHub Desktop.
simple python runner that runs a python script in a given virtual env for cron
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
VIRTUALENV=$1 | |
SCRIPT=$2 | |
PARAMS="${@:3}" | |
source $VIRTUALENV/bin/activate | |
if [ -f $(dirname $SCRIPT)/requirements.txt ] | |
then | |
pip install -r $(dirname $SCRIPT)/requirements.txt | |
fi | |
python $SCRIPT $PARAMS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment