How to set virtualenv for a crontab?

后端 未结 3 369
醉话见心
醉话见心 2020-12-12 11:34

I want to set up a crontab to run a Python script.

Say the script is something like:

#!/usr/bin/python
print \"hello world\"

Is the

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-12 11:57

    Another solution that works well for me...

    0    9    *    *    *    /path/to/virtenv/bin/python /path/to/cron_script.py
    

    I prefer using python directly from the virtualenv...

提交回复
热议问题