Cron job for Moodle

Cron job for Moodle

από Danni R. -
Αριθμός απαντήσεων: 11

I am running the Cron job for Moodle. Settings on my crontab are:

*/30 * * * * wget -q -O /dev/null


Come to find out, the web hosting service has disabled wget on their servers, therefore, the cron job fails.  I get the following error:

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


What is the suggested work-around if Cron doesn't work on the server? For instance, my home PC is running 24/7 on a DSL cable connection; shoud I install the Moodle-Cron Setup program offered to my PC (Win XP Home) and run it from there?

Thanks for the time it took to read and provide feedback!

Monika

Μέσος όρος βαθμολογίας: -
Σε απάντηση σε Danni R.

Re: Cron job for Moodle

από Howard Miller -
Φωτογραφία Core developers Φωτογραφία Documentation writers Φωτογραφία Particularly helpful Moodlers Φωτογραφία Peer reviewers Φωτογραφία Plugin developers
That isn't the right CRON line. You are completely missing the URL. Are you *sure* that wget is disabled? If so, there has been quite a bit of discussion about this in the past, there are some hacks that prod the cron.php script every time a certain event happens in Moodle, which is a bit unreliable but gets the job done.
Σε απάντηση σε Howard Miller

Re: Cron job for Moodle

από Danni R. -

Yes, Howard, I realize now that the URL was dropped here in this post, but it is all there on the Crontab. The web host tech service has confirmed that they have disabled wget because of recent spam activity on the servers.

Thank you for posting and confirming this with me.

Monika

Σε απάντηση σε Danni R.

Re: Cron job for Moodle

από Bill Burgos -
Hello Monika,

There are a number of ways to do this:

1. Try the lynx command if it is not blocked:

*/30 * * * * lynx -dump http://example.com/moodle/admin/cron.php > /dev/null

2. Ask your web hosting service to set up a crontab on their server for you. Show them the example you want to have done. They can write the script that will work best for them.

3. Use the Windows Moodle-Cron Setup.

4. Ask someone to set one up on their server.

Hope this helps.
Σε απάντηση σε Bill Burgos

Re: Cron job for Moodle

από Danni R. -

Thank you, Bill, for your suggestions. These are very helpful. I am currently running the Windows Moodle Cron Setup from my PC, and have discarded the Cron tab settings on my web site host server.

I have some other web sites with other hosts, and potentially I could see if their cron would do the job.

However, there is one more question when running the cron job manually from my PC. I enter the URL into my address bar, http://medicalassistant.net/lessons/admin/cron.php and I get the following warning:

Server Time: Sun, 19 Dec 2004 09:01:53 -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


Fatal error:  Call to undefined function:  raise_memory_limit() in /home/medicala/public_html/lessons/admin/cron.php on line 134

Any feedback and ideas on the solution for the "fatal error" warning?

Monika

Σε απάντηση σε Danni R.

Re: Cron job for Moodle

από Bill Burgos -
Monika,

It seems like there is a reference to a function that does not exist in one of the library files or the library file cannot be found.

It would be helpful to let us know the version of Moodle, the server platform and version you are using.

Σε απάντηση σε Bill Burgos

Re: Cron job for Moodle

από Danni R. -

Bill, thank you for being specific. Here is the additional information for you (or anybody reading this thread).

I have Moodle 1.4.2+ (2004083129) hosted on the following system (web hosting server):
Operating System: Linux
Apache Version 1.3.33 (Unix)

From my home I am running Windows XP Home SP2, on an AMD Athlon processor.

``````````````````````````````````````QUESTION``````````````````````````````````````````
To repeat the question:
When running the cron job manually from my PC at home, I enter the URL into my address bar, which is http://medicalassistant.net/lessons/admin/cron.php , and I get the following report followed by a fatal error waring. Any feedback and ideas on the cause and solution is greatly appreciated!!!!

```````````````````````````````````````REPORT````````````````````````````````````````````

Server Time: Sun, 19 Dec 2004 09:01:53 -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


Fatal error:  Call to undefined function:  raise_memory_limit() in /home/medicala/public_html/lessons/admin/cron.php on line 134


Monika

Σε απάντηση σε Danni R.

Re: Cron job for Moodle

από Bill Burgos -
Monika,

The strange thing is that the cron.php file on the version I am using, Moodle 1.4.2(2004083125), does not have the function call:

"raise_memory_limit()"

Google search only brings this:

http://moodle.org/bugs/bug.php?op=show&bugid=2202

Not wanting to risk going over my programming ability, perhaps one of the developers can look into this or you may want to file a bug report.

Bill
Σε απάντηση σε Bill Burgos

Re: Cron job for Moodle

από Martin Dougiamas -
Φωτογραφία Core developers Φωτογραφία Documentation writers Φωτογραφία Moodle HQ Φωτογραφία Particularly helpful Moodlers Φωτογραφία Plugin developers Φωτογραφία Testers
It's recently added ... I think Monika may have a mixed up version of Moodle ... upgrading to 1.4.3 should fix it for sure.
Σε απάντηση σε Martin Dougiamas

Re: Cron job for Moodle

από Danni R. -

You know what, Martin? As I was reading Bill's feedback, I was just beginning to think the same thing you just said. From the way it sounds, I may indeed have a mixed up version of Moodle. I did upgrade not too long ago. I have no indication that something went wrong, but being somewhat new to all this, I may inadvertently done something to that effect.

So. I am going to focus in on your suggestion, and see if I can tackle this issue from this angle. I will keep you posted!

Monika

Σε απάντηση σε Danni R.

Re: Cron job for Moodle

από Danni R. -

I said I would keep you posted, so here is what I did, FYI. A bit verbose, but I love to elaborate on things that are important to me, or where I think it might help someone else.thoughtful


I currently have Moodle 1.4.2+ (2004083129). I downloaded moodle-latest-14.zip file from Moodle to my computer. I found and read the instructions on how to upgrade Moodle. In reading, I found the instructions somewhat complicated, but nevertheless attempted to follow them. I started the process by attemting to transfer the entire Moodle directory from the host server down to my PC via FTP. Half-way through the process, I realized that the amount of files (55 MB) was much too much for me to be willing to wait on, so I canceled the process half way through.

Next, I decided to just use my FTP program to rename the moodle directory to ~.old and then went into the c-Panel and used File-Manager to upload the moodle-latest-14.zip file. That worked, but I couldn't figure out how to unzip it. So I deleted it again.

As a last resort, in remembering that you said, that you had the function:  raise_memory_limit() in your moodlelib (lib) file, I used a neat little freeware program, called FreeDiff, a free file comparison tool for Windows 95/98/ME - Windows 2000/NT/XP offered at http://www.SaltyBrine.com to compare the contents of my moodlelib file with the latest one from the moodle-latest-14.zip file. And indeed, my current moodlelib file was considerably different, and it did NOT have the raise_memory_limit() in it.

So, I renamed my current moodlelib file to ~.old and transferred the latest moodlelib file via FTP into the lib directory. And voila, now the cron job runs!!!! So for now, this fix is good enough.


In closing, let me just add that I find a manual upgrade of my current Moodle to the moodle-latest-14.zip too complicated. I am a medical assistant and know how to give injections, and know that a surgeon can operate or approach a complicated integral calculus instead of a renal one! LOL

But here I seem to either lack the technical know-how or unable to understand the technical lingo of how to back up important databases, using MySQL, unpacking new archives, and retrieving my old configurations, etc. Too bad, but I think I can live with the way things are running with Moodle 1.4.2+. evil

Monika
dba Danni R.

Σε απάντηση σε Bill Burgos

Re: Cron job for Moodle

από Danni R. -

I agree with you Bill. I found the exact same reference in Google, which is similar but not quite the same situation. I agree on the "strange thing", because if you look at the cron.php with your text editor, there doesn't seem to be a function "raise_memory_limit()" in the script.


I have indeed posted a request into the Developer Testing (or so) forum. Let's see if someone responds.

Thanks for all your help anyway. Have a wonderful week!

Monika