Cron backup problem (cron.php?), Part II

Cron backup problem (cron.php?), Part II

by Steven Day -
Number of replies: 19
Well, I guess that did not solve the problem (see posting below).

So, I first downloaded the latest version of the /admin/cron.php file. Still no luck. Then I changed the cron command to what was listed on the above file (it was different, for some reason, though appeared to be running backups everyday as specified). Now, I'm getting these errors again everytime the cron runs:

/bin/sh: line 1: etc: command not found

Sorry, I don't really understand at this point what would be best to do. The backup appears to be running fine. But getting this email message very 15 minutes is annoying and creating lots of extra mail.

TIA.

Steven
Average of ratings: -
In reply to Steven Day

Re: Cron backup problem (cron.php?), Part II

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The problem is not Moodle cron, but your system cron. What did you put in the system cron to run Moodle's cron?

BTW, please keep one issue per one thread ... "below" is relative at all times.  wink
In reply to Martin Dougiamas

Re: Cron backup problem (cron.php?), Part II

by Steven Day -
The webhost support staff do not seem to know what the problem may be. So I thought I'd try here. The command, which should be correct, is:

* wget -q -O /dev/null http://www.stevenday.us/moodle/admin/cron.php


Again, everything seems to be running smoothly; I just don't want all those emails.

I'll post with relativity, or deictics, in mind in the future. blush

Thanks Martin.
In reply to Steven Day

Re: Cron backup problem (cron.php?), Part II

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
That line looks OK, but I suspect you have another, spurious, line in your crontab, starting with "etc".

If you have shell access type "crontab -l" to see your whole crontab.

If it looks OK then this is really a matter for your webhost support.
In reply to Martin Dougiamas

Re: Cron backup problem (cron.php?), Part II

by Steven Day -
Thanks Martin.

I can get shell access, but only after sending in proof of identification to Surpass hosting.

After uploading the latest /admin/cron.php file, I now get the following error message:

Fatal error: Call to undefined function: mtrace() in /home/stevend/public_html/moodle/admin/cron.php on line 40

I seem to recall line 40 is:

mtrace ("pre");
 also seems to be the same as "line 1" in the old cron.php file. Could that be giving me trouble somehow? 

Until I get shell access, I suppose there is no other way to check the whole crontab.

Thanks again.
In reply to Steven Day

Re: Cron backup problem (cron.php?), Part II

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
You can't upgrade individual files in Moodle like that  ... go back to the original one or upgrade everything at once.
In reply to Martin Dougiamas

Re: Cron backup problem (cron.php?), Part II

by Steven Day -
OK, that will happen shortly with 1.4.

Thanks.
In reply to Steven Day

Re: Cron backup problem (cron.php?), Part II

by W Page -
Steve

  • Do you have CPanel?
  • Has you webhost upgraded CPanel or  made some changes to the server just before this cron problem began?  You need to ask them about that.
WP1
In reply to W Page

Re: Cron backup problem (cron.php?), Part II

by Steven Day -
Hi WP,

Yes, I am using CPanel. If my Webhost has made any changes, you think they'd have mentioned it when I brought the problem up. They originally claimed it was because a backup file was missing, which made the cron task look for it in vain. After creating a dummy file, the problem persisted however.

Martin suggested shell access; so if I send in proof of id, Surpass Hosting will grant it (which is nice, since some hosts do not permit it). For now, I'm just filtering all those error messages into the deleted items folder.

As to server changes, come to think of it, I'm getting much faster ping times now. So they may have upgraded servers (after getting hit by Charley in Florida).

Thanks for your help.

Steven

PS Knock on wood; the webhost is not even accessible now!
In reply to Steven Day

Re: Cron backup problem (cron.php?), Part II

by W Page -
Hi Steven,

My WebHost upgraded CPanel and all my "crons" went crazy. I got a message similar to what you are getting now. This happenned when they upgraded to build 8. I began to get over 400 emails a day.

It took quite a while, even with the WebHost trying to figure out what happened, to get it together.

This is an example of my present "cron" [Using the "Standard" view in CPanel.]
*/5 * * * * php -f /home/abc1111/public_html/moodle/admin/cron.php > /dev/null

"/home/abc1111/public_html/" is the direct server path to the Moodle directory.

Do not ask me what all those words and codes mean, because I sure do not know.

Hope this helps.

WP1
In reply to W Page

Re: Cron backup problem (cron.php?), Part II

by Steven Day -
Wow, this helps greatly!!! Actually, I noticed once that the actual cron command was different--even though I had not changed it. It occurred to me that my host changed it; but since it was different from the command listed in the cron.php file, I changed it back to *wget -o -q dev/null .....

I'll ask them directly if they've upgraded recently. BTW, what version of Moodle?

Thanks so much.

Best,

Steven
In reply to Steven Day

Re: Cron backup problem (cron.php?), Part II

by Steven Day -
BINGO!
In reply to Steven Day

Re: Cron backup problem (cron.php?), Part II

by W Page -
Steven!

Is it resolved?

WP1
In reply to W Page

Re: Cron backup problem (cron.php?), Part II

by Steven Day -
Good question WP1. They changed the crontab command, basically dropping the leading *. Now I don't get the error messages, but it's also not backing up either. Not sure if the cron is even running at all (which would explain why the error messages ceased). So, in short, I'm still working on it.

Any *nix experts care to comment?

Thanks for your concern. At this point, I want to wait for the upgrade and work on it after that.

Best,

Steven
In reply to Steven Day

Re: Cron backup problem (cron.php?), Part II

by Steven Day -
I'm quite sure they made an error changing the cron command now. Wow, they appear to know less than I do! So for now, I set it back to the original *wget.... and did not include my email address. Although I won't get all the error messages, backup updates will not go out either.

Looking forward to 1.4 shortly!

Thanks Martin et al.
In reply to Steven Day

Re: Cron backup problem (cron.php?), Part II

by W Page -
Hi Steven,

You have to have the */5 in the first cron box or the cron will not run every 5 minutes.

WP1
In reply to W Page

Re: Cron backup problem (cron.php?), Part II

by Steven Day -
Hi WP1,

Right, it is set at */5; what the web host support staff did was to get rid of the * before the wget command. Right now, nothing is working it appears with the cron. So I need to deal with them some more. I don't expect them to know so much about scripting; but it would be nice if they knew more about Unix.

Again, I'll wait for to upgrade at this point.

Thanks.

Steven
In reply to Steven Day

Re: Cron backup problem (cron.php?), Part II

by Kingsley Kerce -
Hi Steven -- Why are you leading the command with an asterisk?

If you reply, please include a screenshot of your hosting provider's crontab configuration page/screen.

In reply to Kingsley Kerce

Re: Cron backup problem (cron.php?), Part II

by Steven Day -
Hi Kingsley,

Um, the short answer is I'm not quite sure what I'm doing here. No Unix background at all (obviously). Thought that originally there was an asterisk leading the command.

I'm going to upgrade now to 1.4, then see how things go. If I still have problems, I can include a screenshot or the proper information. It actually was working fine at some point.

Thanks!

Steven
In reply to Steven Day

Re: Cron backup problem (cron.php?), Part II

by Steven Day -
OK, I think all the problems were a combination of things. After upgrading and resetting the cron command, it appears all is operating normally again.

Thanks to everyone for their concern and help.