Difference between revisions of "Configuration-Cron tab"

From JReviews Documentation
Jump to: navigation, search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<div class="successbox" style="width: 95%">
  
[[File:conf-cron.png]]
+
[https://www.jreviews.com/docs/cron There's a new version of this article]
  
Running the JReviews cron url is required for maintenance purposes (rebuilding ranks and purging cache). If '''Run Cron on site visits''' is enabled, it will run automatically by JReviews when required. If you have a large site, it is recommended to disable this and instead setup a cron job on your server using the url from '''Cron url'''.
+
</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.
 +
 
 +
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.
 +
 
 +
<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]]
  
  
 
[[Category:JReviews]]
 
[[Category:JReviews]]
 
[[Category:Settings]]
 
[[Category:Settings]]

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 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