Crontab not executing a Python script?

前端 未结 15 1545
囚心锁ツ
囚心锁ツ 2020-11-29 20:42

My python script is not running under my crontab.

I have placed this in the python script at the top:

#!/usr/bin/python

I hav

15条回答
  •  旧巷少年郎
    2020-11-29 20:52

    Sometimes I am facing same problem. Whatever I try something as advised here, I may not get result.

    So I begin to write "trigger" bash script as follow (let's name it trigger.sh):

    #!/bin/bash
    
    /full_path/python_script.py
    

    And I am calling trigger.sh from crontab and everything is fine.

    EDIT: Of course, don't forget to do following (give execution right):

    $chmod +x python_script.py
    $chmod +x trigger.sh
    

提交回复
热议问题