Crontab wont run python script

后端 未结 1 1957
春和景丽
春和景丽 2020-12-17 20:27

When I execute my python script from the command line I have no problems like so:

[rv@med240-183 db]$ python formatdb.py
[rv@med240-183 db]$

相关标签:
1条回答
  • 2020-12-17 20:39

    Add

    #!/usr/bin/env python
    

    to the beginning of your script - right now it's trying to execute your script as a bash, that line says "I'm a python script, please use the right interpreter". It's also called a hash-bang line, but it needs to be the first line in your script.

    0 讨论(0)
提交回复
热议问题