I’m still finding that I have mail from cron each time the job executes. I believe I may have found the answer this time. I was originally writing the output of the last command to a null pointer. I went ahead and made sure that all commands calling php5 are now writing to nothing.
This then left me with just one error in my mails. Something about an unterminated string value. I couldn’t find any strings that were not closed. I went ahead and found that I could remove the quotes everywhere since I wasn’t using any spaces. When I did this, I found that it was now complaining about an unknown sle command. AH HA! Apparently there is a limit to the length of my commands
for((i = 0; i < 5; i++)) do echo $i; sleep 1; done
Using a loop, I was able to get 39 commands trimmed down to about 10 percent of their initial size.
It’s not always a perfect world though. As I find things that appear to work, I often find that they don’t work as expected. Even though my tests worked directly on the command line, I’m still getting feedback from the cron manager about problems. The latest one is “/bin/sh: Syntax error: Bad for loop variable”.
This latest error indicates that there are different interpretors that don’t understan the script in the same way as others. The crontab appears to run things in a different context then the command line itself. I’m running back looking at batch files again (shell scripts), because the first line allows you to identify which interpretor to use when processing the scripts. It’s plenty of techno babel I suppose, but I’m determined to find a working, proper solution to this problem.