0

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

3
  • 1
    I believe that issue is with linkchecker not being found in environment when running within os.system. Try giving absolute path to linkchecker. Commented Jun 21, 2013 at 4:10
  • sh: 1: /opt/linkchecker/: Permission denied When I git abs path to linkchecker Commented Jul 16, 2013 at 7:41
  • your tips give me an idea,thanks Commented Jul 18, 2013 at 2:13

1 Answer 1

1

try like this

   */2 * * * * python /opt/badlink.py
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.