Hi all, i hope someone can advise on a strange issue i am having with one simple cron job.
So i create the job to run every 1 hour and that is all fine. The job triggers via root account and executes a python script.
When i run the python script via sudo manually it goes from start to finish without issue. When it runs from the cron job however it seems to always stop at ~5 minutes of it's execution.
I have tried adding timeout in front of the python call, but then the job doesn't start at all.
Strange issue with cron job
Re: Strange issue with cron job
There is no time limit on cronjobs.
I would make sure that you have both stdout and stderr from the job redirected to files so that you can see what it says. So along the lines of
0 * * * * /usr/local/bin/mycron.sh >/var/log/mycronout.log 2>/var/log/mycronerr.log
I would make sure that you have both stdout and stderr from the job redirected to files so that you can see what it says. So along the lines of
0 * * * * /usr/local/bin/mycron.sh >/var/log/mycronout.log 2>/var/log/mycronerr.log
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Strange issue with cron job
Thank you sir! This helped me understand where the script fails. Still wonder why it passes through when executed manually though.
Anyway i made slight change to the script and the cron job runs ok now.
Anyway i made slight change to the script and the cron job runs ok now.