Cron not running after migration

Cron not running after migration

by Serena Marangoni -
Number of replies: 7
We migrated our moodle website to a new server by "copy paste". The website works but cron hasn't run in a year.


Our programmer ruled out problems with server but even going through moodle settings he can't find anything wrong. He suspects there's 'hidden' parameter that he can't find where the previous server is still configured instead of the correct one. 

The website was just updated to version 4 and everything else works correctly. 

Average of ratings: -
In reply to Serena Marangoni

Re: Cron not running after migration

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
You have to set up cron to run on the new server. It is not a moodle setting - it is a server side thing. Follow the instructions in the docs.
In reply to Emma Richardson

Ri: Re: Cron not running after migration

by Sisthema Formazione -
Thank you! The php programmer has looked at all the settings and hasn't found any faults with them. He can set the cron to run manually, but it won't run automatically. The only workaround he's found would be to run the cron from another server. Can you tell me in which docs we can find info on the cron?
In reply to Sisthema Formazione

Re: Ri: Re: Cron not running after migration

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators

Where did you find the "copy and paste" instructions on upgrading Moodle? There might be other interested people.

Moodle's cron job has to be run from outside of Moodle, means the operating system (platform) is involved. Therefore information about your platform is relevant.

BTW, to run Moodle, no PHP programming is required.
In reply to Visvanath Ratnaweera

Ri: Re: Ri: Re: Cron not running after migration

by Sisthema Formazione -
I did not find those instructions, the person who migrated the website gave me that description, they just moved it to a new server without changing the settings. They then changed some settings for the emails, but that was it. They didn't find other settings to change.

The platform where the server is installed or the platform that I'm using to view the website? I think it's a linux server but I'll have to ask.
It was installed through Softaculous, which is available for the installation of several platforms from our server's interface.

I know no php is required. I've been running it for two years now and my understanding of php and web development in general is very limited.

Thanks for linking the docs. I thought there was something else that I had missed, that one I'd read. What isn't clear to me is, why did it run automatically on the previous server, and now I have to install it on another sever and run it via web? Is there no way of restoring the way it was running before?
In reply to Sisthema Formazione

Re: Ri: Re: Ri: Re: Cron not running after migration

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

You said:
> they just moved it to a new server without changing the settings. They then changed some settings for the emails, but that was it. They didn't find other settings to change.

Then "they" haven't run a single Moodle site! The Cron is a must for any Moodle site, right from version 1.0 in 2002. Not that anybody is born with experience in Moodle, but if somebody provides a commercial Moodle, that person is well-advised to read the Moodle Docs and even better, participate in these forums.

> It was installed through Softaculous, which is available for the installation of several platforms from our server's interface.

Oh, dear! Pl. see https://moodle.org/mod/forum/discuss.php?d=437524#p1760909 ;)
In reply to Sisthema Formazione

Ri: Re: Ri: Re: Cron not running after migration

by Sergio Rabellino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
So, please ask softaculous for support, not here, as they change the standard distribution of moodle in a custom way.
In reply to Serena Marangoni

Re: Cron not running after migration

by Ken Task -
Picture of Particularly helpful Moodlers
+1 to what Sergio said.
To get help from Softac folks, look in upper right hand corner of the Softac screen for a link to their help desk.

Cron job - in your cPanel, there should be an icon for setting up a cron job.  That does require one to know the path to php-cli on your system (there are really 2 PHP execs - one that runs web and one that runs from command line).

Now some questions for you ... does your cPanel have the following icons:
1. a Terminal Icon
2. a Git Icon.

Terminal will help you find the path to php-cli and the path to your moodle code by typing some commands ([ENTER] means you press the ENTER key on your keyboard):

which php [ENTER]

will show a path to php-cli
To make sure it's php-cli, type: php -v [ENTER] you will see (php-cli) in what that returns.
The other path is the path to your moodle code.
Moodle code has a config-dist.php file so to find the path to moodle code:

find ./ -name config-dist.php [ENTER]

What that command returns is the path to your moodle - minus the config-dist.php, of course.

The Git icon is a way to avoid Softac .. but that's for later discussion/cussion!

'SoS', Ken