General developer forum

problems with cron job?

 
Picture of Eric Lin
problems with cron job?
 

Hi Moodlers,


I've had a couple of recurring and thorny problems with my moodle site, and I think this can be traced back to probems with cron jobs. 

Two things: I can't seem to get notifications  out to forum subscribers (including announcements, with forced subscriptions), and I also cannot delete events/quizzes. Though they don't appear on the website, the gradebook constantly has them there as deletion in progress. 

I think this because the cron job is not working right. I get this error from the daemon:

ericxlin@siteground238 [~/public_html/courses]# php -q /home/ericxlin/public_html/courses/courses/admin/cli/cron.php
Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

I have this hosted at siteground, and the tech support people have tried just about everything to trouble shoot, but they can't seem to get this fixed. Is there anyone who has experience with third party hosting, and might be able to point me in the right direction on this cron job problem?


 
Average of ratings: -
Picture of Ken Task
Re: problems with cron job?
Particularly helpful Moodlers

Have to chuckle ... 'anyone who has experience with third party hosting' is just  about everyone in these forums.  Really what one should have asked .... anyone who has experience with hosting at SiteGround.

So if siteground's tech support has 'tried everything', maybe SiteGround is not such a good place to host a moodle.  SiteGround is well known for 'cheap' hosting ... one gets what one pays for.   Yep, not very high on SiteGround.

That being said ... let's talk about the setup of the cron job.

The cron job command you've shared points to *two* 'courses' folders .... which 'courses' folder has a config.php file in it?   That's the path to the *moodlecode*.  Then one adds the /admin/cli/cron.php.

Use your cPanel to explore the files.

Think the real problem is the

Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

path to moodledata is a full path ... so your full path would be /home/ericxlin/public_html/moodledata since SiteGround doesn't really give you full control of Apache, your 'moodledata' directory has to reside in public_html for Apache to see it.  

*Very Important* ... in moodledata there *needs* to be an .htaccess file ... note the dot in front of htaccess.

That file should contain:

deny from all
AllowOverride None
Note: this file is broken intentionally, we do not want anybody to undo it in subdirectory!

Otherwise, your moodledata directory will be viewable by anyone using a browser.

If that .htaccess file does not reside in your moodledata, create one with your cPanel.

Feel free to pass this along to SiteGround support .... if they'd like to 'defend themselves', maybe we can get one of them in these forums to discuss/cuss the issue so they can support their customers.

'spirit of sharing', Ken


 
Average of ratings: -
Picture of Visvanath Ratnaweera
Re: problems with cron job?
Particularly helpful Moodlers
> Have to chuckle ... 'anyone who has experience with third party hosting'

Chuckling further...
smile

How many "third party hosting" are there? Well, here is one current story: "TeX Filter doesn't work" https://moodle.org/mod/forum/discuss.php?d=371549.

In any case, we can not expect the Moodle developers to work with the "third parties". A more suitable forum for this discussion is the "Installing and upgrading help" https://moodle.org/mod/forum/view.php?id=28.
 
Average of ratings: -
Picture of Eric Lin
Re: problems with cron job?
 

Thanks, I'll take this up with their help, and perhaps seek hosting services elsewhere, if I can't get a resolution.

 
Average of ratings: -