Mail problem--getting the cron set up right

Mail problem--getting the cron set up right

Lennie Irvin
Vastuste arv 3

I'm having some difficulties getting the mail to send automatically via the cron.  I have followed the installation guide and successfully installed moodle on my own webhosted space using a Cpanel interface.  No problem.

I followed the instructions for setting up the cron, and my cpanel provided an excellent interface for doing so.  I've had my own moodle mail settings both through smpt and then left blank to let the php do the mail.  I've checked that my cron file works, and it does.  I've had an extensive number of back and forth correspondences with my webhosting folks, and I still haven't found a solution. 

I think the problem may be a permissions problem, and I was hoping someone might have run into this problem too and know a solution.  About two to three times a day, I receive an email from the cron daemon of my webhost that reads:

/bin/sh: /usr/bin/wget: Permission denied

Someone from my webhost suggested I go in an change the permissions on the cron.php file.  My question is whether this is the file I should change the permissions for?  What should its permissions be. I noticed that for this file the read and write privileges were checked, but not "execute."

Keskmine hinnang: -
Vastuses Lennie Irvin

Re: Mail problem--getting the cron set up right

N Hansen
Is your site publicly available? The reason I ask is I had a similar problem (using cpanel) because I have password-protected my whole site (via .htaccess) and in order for cron to work I had to pass the username and password variables through as part of the cron job for it to be able to access cron.php.
Vastuses N Hansen

Re: Mail problem--getting the cron set up right

Lennie Irvin
No, my moodle site is publically available as well as the materials I have hosted.   Something is getting hung as it attempts to run the cron.php file.  Perhaps some clues are in the regular cron daemon mail I get. It has this in the heading:

Subject: Cron <lirvin@partners3> wget -q -O /dev/null http://lirvin.net/moodle/admin/cron.php
X-Cron-Env: <MAILTO=lirvin@accd.edu>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/lirvin>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=lirvin>

The message of the email reads:
/bin/sh: /usr/bin/wget: Permission denied

Somewhere I don't have the correct permissions to run the wget command.

I get this mail message two to four times a day.  I haven't determined a regular time or reason why I get it at certain times.  I have my cron set to run every five minutes.

Any help would be appreciated.

Lennie
Vastuses N Hansen

Re: Mail problem--getting the cron set up right

R G

Hya Hansen,

How can I "pass through" the username and password variables in cpanel?

Cheers