Difference between revisions of "Configuration-Cron tab"
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | <div class="successbox" style="width: 95%"> | ||
+ | |||
+ | [https://www.jreviews.com/docs/cron There's a new version of this article] | ||
+ | |||
+ | </div> | ||
+ | |||
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. | 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. | ||
Line 6: | Line 12: | ||
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 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. | ||
+ | |||
+ | <div class="mw-help-field-data small">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.'''</div> | ||
+ | |||
+ | You can add the cron using wget to call the URL like this: | ||
+ | |||
+ | <source lang="bash"> | ||
+ | * * * * * wget -O /dev/null -o /dev/null https://yourdomain.com/index.php?option=com_jreviews&format=raw&url=cron&secret=CRON_SECRET | ||
+ | </source> | ||
+ | |||
+ | 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: | ||
+ | |||
+ | <source lang="php"> | ||
+ | <?php | ||
+ | file_get_contents('https://yourdomain.com/index.php?option=com_jreviews&format=raw&url=cron&secret=CRON_SECRET | ||
+ | '); | ||
+ | </source> | ||
+ | |||
+ | Then you can setup up the cron to run every minute like this: | ||
+ | |||
+ | <source lang="bash"> | ||
+ | * * * * * /usr/local/bin/php /home/user/public_html/jreviews-cron.php | ||
+ | </source> | ||
+ | |||
+ | 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. | ||
[[File:conf-cron.png]] | [[File:conf-cron.png]] |
Latest revision as of 23:25, 2 August 2020
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 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.