Cron job not storing errors/results to log
I have a few Cron jobs 开发者_如何学运维running using 'wget' on my server, none of which are storing errors/results to a log file. Each of the command lines is identical except the specific controller and function called. I'm having trouble with one of the cron jobs, even though if I navigate to it in the browser it works without a hitch; the other two run just fine, but none of the three seem to create any log file.
Here is the command line:
wget -q -O cron_job.log http://www.mydomain.com/controller/fxn
I thought that the options I'm using would keep the log file with only the most recent log entry, i.e., the last cron job to run (they all run at different times).
Can you tell me what I'm doing wrong?
The Option -O is for the output-document. If you want to log the Output of wget use the -o. But this overrides the content of the log-file, so it is better to use -a.
wget -a cron_job.log http://www.mydomain.com/controller/fxn
If you want to log the output-document of the request, try this:
wget -q -O - http://www.mydomain.com/controller/fxn >> cron_job.log
精彩评论