Forum Moderators: coopster

Message Too Old, No Replies

my first cron: script runs as expected, but...

inconsistently updates a daily log file

         

mgm_03

12:56 pm on Jul 16, 2005 (gmt 0)

10+ Year Member



I've got a cron that executes a script every hour. The script looks for files in directory and processes them. It creates an entry in a log file every time it runs even when no files are found.

For reasons I have not yet determined, sometimes the log file just doesn't get updated each hour. I do know the script is executing every hour.

The only idea I have left is maybe there are permission problems.

The script creates a log file with 644 permissions. That tells me that the webserver is the owner...yes? If yes, it should not have problems updating the file. The log file is opened using fopen(file, 'a') and therefore, appends new log entries.

Php is running in safe_mode.

Has anyone experienced a similar problem?

ergophobe

3:13 pm on Jul 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hmm. How do you know the script is running every hour if it's not creating the log entry?

Assuming it is, is there any condition in the script that could possibly result in no entry being written? Put another way, is it possible that the script would do all of its processing and decide that the appropriate entry is an empty string, which would appear as no entry?

Just brainstorming a bit.

mgm_03

7:13 pm on Jul 16, 2005 (gmt 0)

10+ Year Member



I do sub-contract work for the hosting company that set the cron to run.

As the script runs, I've put 'logging points' all over the place to know what's happening (or not happening).

I just checked the log...it seems to be working now on the regular interval. Hopefully, I did something to make it work or removed something that made it not work.... I tend to make things work by trial and error instead of acutally knowing what I'm doing ;-)