CRON no longer working

CRON no longer working

by Colin McQueen -
Number of replies: 2
I have had cron working OK on our hosted site until today at 12.00  whjen I started receiving an email

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

every 15 mins.

Having asked the support service I was told:-

"Due to a range of security attacks we have had to harden the servers. This now means that you won't be able to execute anything without it being local to stop cron attacks."

It's odd but this started just after I had called cron via a URL to check whether RSS feeds were working. Do you think their response was a response to this?

Does their email mean I cannot use cron anymore or is there a way to run cron locally on their server. I thought it was anyway?
Average of ratings: -
In reply to Colin McQueen

Re: CRON no longer working

by Jan Dierckx -

There or more providers who don't allow the use of wget on cronjobs. I don't think your calling of cron via a url had anything to do with it.

Ask them if you are allowed to run lynx or a commandline version of php. Ask them which path you need to provide to lynx or the php executable. Then you can setup a cronjob to run

/path/to/php /yourweb/yourmoodle/admin/cron.php

every 5 or 10 minutes.

More examples / explanations

In reply to Jan Dierckx

Re: CRON no longer working

by Colin McQueen -
Thanks for this. I had seen the documentation but was wondering if the wget just needed a local filename to work with. I ended up getting very helpful support from my hosting supplier who informed me they had actually stopped any use of wget now. The lynx command is also denied.

The hosting support guys recommended a similar solution to one of those in docs.moodle.org i.e.

php -f /home/username/public_html/moodle/admin/cron.php > /dev/null

which works. At least it seems to. Nb using -f is needed because I am passing a filename not a web address.

However I now get emails with

"doesn't appear to be a valid Zend extension"

which looks like it's a warning not an error so cron still completes the cron job (I think)

I have tried using --quiet and then I get the output from the cron job with that zend bit first. I thought this would suppress all errors and warnings?

I was wondering why the > /dev/null doesn't prevent me receiving the emails but apparently it's only needed if the output isn't written to an email so I guess I can lose that bit.

I only want to get emails if the cron job fails. Anyone have a definitive answer on how i might get this?