Jump to content

crontab error


uktrips007

Recommended Posts

It could be failing due to the working directory, particularly if you use relative paths to include other files.  It also could be failing due to permission problems.

For this kind of "blind" debugging, you can try logging debugging output to a file.  A good start is to have a line at the very top of your script like

[code=php:0]file_put_contents('/tmp/I_have_run.' . posix_getpid(), date('[Y-m-d H:i:s] Script executed';[/code]


That'll create a file each time your script runs.  If the file isn't created, that means the script is not even starting.  Or the script is not allowed to write to /tmp (quite possible if it's running under the web browser).  Try putting that both before and after any include() or require() you may have.
Link to comment
https://forums.phpfreaks.com/topic/30599-crontab-error/#findComment-140947
Share on other sites

Hi dear!

Thanks for your prompt answer.but I have checked permission it's fine.Also I never use relative path and have used complete path.but it's not running from crontab of a specific user.but it is running from shell as well as root crontab.permission is also 755so i think it must run.can u help me.
Link to comment
https://forums.phpfreaks.com/topic/30599-crontab-error/#findComment-141056
Share on other sites

just curious....did you compose the script on a Windows system?

The reason I ask is that some shell scripts will not execute from a crontab if there are unfamiliar (text) characters that may be hidden.

some "Window's" apps leave hidden characters within a text file that can cause problems running scripts from CRON.  I have had scripts that work fine when executed from a bash prompt but would not execute when called from a crontab.

sory if this does no apply to your problem...Good Luck
Link to comment
https://forums.phpfreaks.com/topic/30599-crontab-error/#findComment-141194
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.