Saturday, 24 August 2013

writing crontab from cron script returns 127 error

writing crontab from cron script returns 127 error

I'm working with some scripts which must be executed from crontab. Some of
them rewrite crontab.
in.php defines if read.php should be run by crontab. Then read.php is
executed by crontab. This works fine.
When read.php is executed, it might detect that it should be not running,
if this happens, it rewrites crontab to avoid its own execution, until
in.php rewrites crontab again). The problem is that this second step is
not working.
I have been looking for the error and I have found that my cron.txt is
correctly written. However, crontab command fails and returns 127 error.
But when I execute read.php manually all works fine.
Both scripts use the same functions to rewrite crontab. But this is
happening just in read.php, not in in.php.
Is there a time to rewrite crontab since it executes a task? It may
explain my problem, because in.php takes longer time to be executed than
read.php.
Thank you!

No comments:

Post a Comment