Support for automatically activating virtualenv for cronjob
authorMagnus Hagander <magnus@hagander.net>
Fri, 1 Jan 2016 16:41:08 +0000 (17:41 +0100)
committerMagnus Hagander <magnus@hagander.net>
Fri, 1 Jan 2016 16:41:08 +0000 (17:41 +0100)
planet_run.sh

index 154480b285164bee49568aea1fe944ec6bb0fa75..e84221b740d3ff12a172e5d115f8d00ba3a8e066 100755 (executable)
@@ -2,6 +2,11 @@
 
 cd /home/planetpg/planet
 date >> planet.log
+
+if [ -L virtualenv_activate ]; then
+    # If there is a link to a virtualenv present, activate that virtualenv before running
+    source virtualenv_activate
+fi
 python aggregator.py >> planet.log 2>&1
 python generator.py >>planet.log 2>&1
 python posttotwitter.py >>planet.log 2>&1