Configure the CRON

I need help setting up CRON. User or Hostinger and could not configure the CRON. I have tried some dictionaries on other topics but to no avail. If anyone can help me thank you.

  • I've read all this documentation, and the link to configure the cpanel is broken. So I could not perform the configuration.

  • I apologize, but I actually located this page on Google. But cPanel's help was not enough. I'm having trouble setting up CRON on Hostinger, they informed me that this should be seen with developer. I'm not hitting the configuration in their cPanel. Appreciate your help.

  • We don't have vendor specific instructions. If your host fails to provide you with necessary support, maybe you should change the host. Setting up cron should not require a university degree.

  • Setting up cronjobs in cPanel requires to select the time interval the job should be executed. Some typical intervals can be easily selected on the cronjob config page in cPanel. But it's not too difficult to select custom intervals either.

    Then you need to enter the command that is supposed to be executed by the cronjob at the given interval. In case of Elgg the only task the cronjobs need to do is to visit a certain url of your Elgg site (corresponding with the cron interval). If Elgg notices a visit to these urls it handles the execution of the scripts registered by Elgg core or plugins for these intervals internally.

    For example the one minute cronjob command could look like this

    /usr/bin/lwp-request -m GET -d http://YOUR.SITE.URL/cron/minute/

    This command assumes that the lwp-request tool is installed on the server at /usr/bin/. If the path is different, you need to adjust the path to the lwp-request executable. If lwp-request is not available, the wget command most likely is and in this case the command could be

    /usr/bin/wget --output-document=/dev/null http://YOUR.SITE.URL/cron/minute/ >/dev/null 2>&1

    Again, you might need to adjust the path to the wget executable. And you would also need to change the url of your site (either with http or https) accordingly.

    The other cronjob commands are basically the same with the only difference in the last part of the url in the command, e.g. hourly for the 1 hour interval cronjob. The urls for the Elgg cronjobs are shown in http://learn.elgg.org/en/2.0/admin/cron.html. You don't need to set up a cronjob for the reboot interval anymore.

    In case you absolutely don't get the configuration of the cronjobs working, you can use the Crontrigger plugin available at https://elgg.org/plugins/2512029. This plugin simulates the triggering of the cronjobs (though in kind of a poor manner as it requires at least one visitor on the site being active at any given time for the cronjobs to be triggered. Only a user action will trigger the cronjobs that need to be executed since the time of the last user action. Therefore, the cronjobs might not be executed at the exact intervals and several cronjobs might be triggered at the same time if the site has been without visitors for some time.

  • Thank you iionly attention, your explanation was very helpful. I'll do some testing now.