Configuration-Cron tab

From JReviews Documentation
Revision as of 23:25, 2 August 2020 by Jreviews (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Setting up the JReviews Cron is required to periodically run maintenance tasks (rebuilding ranks, media counts, purging cache, etc.), and also for processing certain tasks that should not be processed during site visits, like sending emails in bulk.

Although we've built a feature to run certain cron tasks on site visits, not all tasks can be run this way, so setting up the cron is highly recommended.

To setup the cron, use your hosting panel's cron configuration tool and add the Cron URL provided in the JReviews admin dashboard after replacing the secret string with the one shown in the dashboard.

You should setup the cron to run every minute. Not all tasks will be processed every minute, but this is the best way to ensure that all tasks are run periodically.

You can test if the Cron URL you are using is correct, by pasting it in your browser. If it's working correctly you will see the message Cron ran successfully.

You can add the cron using wget to call the URL like this:

* * * * * wget -O /dev/null -o /dev/null https://yourdomain.com/index.php?option=com_jreviews&format=raw&url=cron&secret=CRON_SECRET

If you have problems setting up a cron job to run a URL using wget or lynx, you can also create a new file on the root if your site, with any name you want, like jreviews-cron.php with the following code:

<?php
file_get_contents('https://yourdomain.com/index.php?option=com_jreviews&format=raw&url=cron&secret=CRON_SECRET
');

Then you can setup up the cron to run every minute like this:

* * * * * /usr/local/bin/php /home/user/public_html/jreviews-cron.php

Make sure you replace both your site domain and CRON_SECRET with the value from the JReviews dashboard.

If you are having problems with these approaches, make sure you contact your host for help with setting up the cron.

Conf-cron.png