0

I use centOS, at command line, I execute >./tv.py script and it runs correctly.

But, when I include into /etc/crontab, entry */30 * * * * /root/tv.py , it does not.

What am I doing wrong?

This is the head of script:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
3
  • 1
    Does the file have executable file permissions? Commented Dec 2, 2015 at 7:09
  • You can also see Running a Python Script using Cron? Commented Dec 2, 2015 at 7:11
  • @BrendanAbel Yes, I did chmod 777 tv.py before. Commented Dec 2, 2015 at 7:36

2 Answers 2

2

We need more information to troubleshoot this issue. Namely, you will need to monitor /var/log/syslog and spot errors regarding that cronjob. It is probably also good practice to output an error log for this job.

Sign up to request clarification or add additional context in comments.

1 Comment

thank you tell me about the log information , it help me solved it.
2

I just change the crontab to */30 * * * * root python /root/tv.py and then it running , thanks everyone.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.