Cron

Cron

by Maryam U. -
Number of replies: 14

Hello,

I am a fairly new moodle user.

Installation went well. First month went well. Now during the second month I have started to receive the following message:

Cron <@> wget -q -O /dev/null http://*******/*******/admin/cron.php

and the message body:

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

Everything went well till this point. Now my mail box is filled with the cron messages.

I do not know any programming but I do follow instructions well..

I am grateful if anyone can help!

Thanks,

Maryam

Average of ratings: -
In reply to Maryam U.

Re: Cron

by Tony Hursh -
Are you on a host administered by someone else? If so they may have changed something with the wget permissions. If that's the case, you'll have to ask them to fix it.

If they can't/won't fix it, it's possible to run wget from another computer.

If this a dedicated server over which you have full control (i.e., root access) post again and we can give you some advice on fixing it.





In reply to Maryam U.

Re: Cron

by Steve Hyndman -

Let me guess...you are hosting with Lunarpages? smile

They disabled wget function last Thursday. When you install Moodle from their control panel, the cron is set-up automatically. If this is the case, look in their support forum in the "Control Panel" forum and you will see a post there from me on Friday showing a solution. You will have to reformat your cron job...if you can't find it, let me know and I'll send the directions here.

Steve

In reply to Steve Hyndman

Re: Cron

by Erlyn Baack -

Lunarpages is my host, and I have this problem too.  Is the solution as follows:  php /home/user/public_html/script.php .  If it is, is there a space after the leading php and the /?  Thanks.

In reply to Erlyn Baack

Re: Cron

by Steve Hyndman -

Erlyn,

Yes, there is a space after the leading php...no other spaces. It would look something like this assuming you have moodle in the public_html folder.

php /home/your_user_name/public_html/moodle/admin/cron.php

Replace "your_user_name" with your user name smile . If Moodle is installed in a directory called moodle then leave everything else the same....if not, then replace "moodle" with the name of your install.

Steve

In reply to Steve Hyndman

Re: Cron

by Danni R. -

Oh, great! I just posted a similar request for advice, because my web host has also disabled wget on their servers and the Cron job that was automtically instralled fails with a warning (in my email account) that "permission was denied".

In reading about the PHP solution, I have the following question:

Where exactly would you enter the command string php /home/your_user_name/public_html/moodle/admin/cron.php. I have access through an Admin Interface called c-Panel and am able to set up cron jobs there. Does it go into the cron tab to replace the default setting: wget -q -O /dev/null http://website.net/moodle/admin/cron.php???

Thank you for your much appreciated guidance!

Danni

In reply to Danni R.

Re: Cron

by Steve Hyndman -

Yes, that is what I did...just replaced the wget command with the php command. It is working great for me. I would suggest you set your cron to run and then test it to make sure it's working.

Steve

In reply to Steve Hyndman

Re: Cron

by Danni R. -

Steve, I have done the same thing. I have just replaced the wget command with the php command. However, HOW exactly can I test this new cron setting to make sure it is working? I did not, for example, receive any email notification like previously that told me the cron job failed. Can one assume, that this means it IS running?

Thanks for your suggestion.

Monika

In reply to Danni R.

Re: Cron

by Steve Hyndman -

I Just set the cron to run every 1 minute and when I received the emails from the server I knew it was working. You may want to check and make sure your email address is still entered. On my control panel, there is a place to enter an email address for the results of the cron job to be sent. Once I saw it was working, then I set the cron back to run every 30 minutes.

Steve

In reply to Steve Hyndman

Re: Cron

by Danni R. -

Steve, I followed your and Bill's advise, and my cron job has been running "beautifully" for the past 3 days. I changed the cron tab settings to

0 * * * *  php /home/user_name/public_html/moodle_directory/admin/cron.php

(which means run every year, every month, every day, every hour) and each time the job was successfully executed, I get a report (which used to be an error message in the beginning, when the cron job failed).

For anybody who is a novice (like me) and would find it helpful to see what such an email report might look like, here it is:
Content-type: text/html
X-Powered-By: PHP/4.3.9
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache

<pre>
Server Time: Sun, 26 Dec 2004 00:00:01 -0600

Starting activity modules
Processing module function assignment_cron ...done.
Processing module function chat_cron ...done.
Processing module function forum_cron ...done.
Processing module function journal_cron ...done.
Processing module function workshop_cron ...done.
Finished activity modules
Running backups if required...
    Checking backup status...OK
    Getting admin info
    Deleting old data
    Checking courses
        Skipping deleted courses
  0 courses
        Medical Assistant Basic Reviews & Tutorials
            Next execution: Wednesday,  29 December 2004, 05:00 AM
        Basics of Medical Language and Terminology 101
            Next execution: Wednesday,  29 December 2004, 05:00 AM
        Basics of Human Anatomy (A&P) 101
            Next execution: Wednesday,  29 December 2004, 05:00 AM
        Fundamental Skills Review 101
            Next execution: Wednesday,  29 December 2004, 05:00 AM
        Clinical Skills Review 101
            Next execution: Wednesday,  29 December 2004, 05:00 AM
        Practical Pharmacology Review 101
            Next execution: Wednesday,  29 December 2004, 05:00 AM
    Deleting old logs
Backup tasks finished.
Cron script completed correctly
Execution took 0.233508 seconds

Monika

In reply to Danni R.

Re: Cron

by louis jordan Mr -
I entered into cron " php /home/..../cron.php" and now it emails me this every x minutes:
Content-type: text/html
X-Powered-By: PHP/4.3.11
Set-Cookie: MoodleSession=c577c3d91c4327644f0c8b6d4756fb25; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache

<pre>
Server Time: Thu, 04 Aug 2005 12:03:01 -0400


Starting activity modules
Processing module function assignment_cron ...done.
Processing module function chat_cron ...done.
Processing module function forum_cron ...done.
Processing module function journal_cron ...done.
Processing module function workshop_cron ...done.
Finished activity modules
Running clean-up tasks...
Running backups if required...
Checking backup status...INACTIVE
Backup tasks finished.
Cron script completed correctly
Execution took 10.464776 seconds

However, my confirmation email is not being sent out by the server. 
Last night I had a user tell me he could not enter in his profile.  The description field was the only empty required field that I could see from the admin/panel, but he said hewas certain he filled it in.

I'm not sure this new php cron is working as well as the old wget did before the wget was disabled.  Also, I dont like the php cron sending me an email every x minutes.  I think that could put too much strain on the server cpu & I could get booted for it.  Is there a way to get this stuff working right?       What's going on?      Those of you who recently switched to PHP cron, I suggest you test your new-user registration confirmation emails.  
In reply to louis jordan Mr

Re: Cron

by louis jordan Mr -
Correction: The php cron job sends out emails.  I'm still testing it now.  I'll let anyone know if I find any major problems with the email sending feature for certain using "php /home/.../admin/cron.php".  Assume it's working fine for now.

It looks like the confirmation emails sent to the users who registered when the cron was not working are lost, but thats ok because I can manually confirm them.     
In reply to Steve Hyndman

Re: Cron

by Maryam U. -

No, I am not hosting with Lunarpages.. I am hosting with GlobeDomain.

I have contacted them as one of you advised. So far they have provided an excellent customer service.

Thanks for the advice. I will get back to you if the issue is solved..or is not solved...