I want to schedule a python script to run using cron on certain dates, the problem is that in order for
example.py to work,
example-env has to be activated, is there a way to make
example.py activate its own virtualenv whenever cron execute it?
if not, then do I have to create a bash script
bash.sh that contains
#!/usr/bin/env bash workon example-env python2 example.py
and then schedule that to be executed by cron on certain dates? Or do I have to do something else?
Both ways are fine with me, I just want to know the correct way to do it. Perhaps I prefer the bash script method, since I have many Python files to run, so if I put them all inside a bash script and schedule that, it seems easier for me, but again I don't know the correct way to do it, therefore I'm asking for advice.