Search code examples
pythoncroncron-task

Crontab and python script


My python script: badlink.py (i used http://wummel.github.io/linkchecker/)

#!/usr/bin/python
import os
os.system('linkchecker -ocsv -Fcsv/badlinks.csv www.mysite.com')

My crontab task

*/2 * * * * /opt/badlink.py 

the problem is that If I run directly

python badlink.py I got the output result

My question is why it does not work with cronjob task.

Thanks


Solution

  • try like this

       */2 * * * * python /opt/badlink.py