Hi all,

I'm using crontab on Ubuntu 10.04 and I have had 7 tasks running smoothly for about 6 months. I've now created a new script but for some frustrating reason it will be execute. It's a small task that needs to run every two minutes. The issue doesn't reside with the code as if I execute the script manually it works perfectly. The script is written in PHP and I'm running Apache2.

This works fine:
*/5 * * * * php -q /var/tasks/PEQ.php

This does not:
*/2 * * * * php -q /var/tasks/SSC.php

There are no errors being reported by the script, which has error reporting on, and there are no errors being logged by crontab.

Any ideas?

Thanks in advance!

Recommended Answers

All 2 Replies

are you sure that is not executing?
add log msg at the top of your script:

file_put_contents("/tmp/log.txt", "script executed on " . date('Y-m-d H:i:s'));

then check if the file exists in /tmp

To you have the script language defined in the 1st line to be php? From command line, do you just run './SSC.php' and it runs or do you pass it into the scripting language module? Does the script have new external commands that require permissions that the id running this cron doesn't have?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.