Describing what is cron and how you can setup cron-job manually.
What is cron?
Cron is time-based time scheduler in Unix-like Operating System. Cron job are used to schedule commands to be executed periodically. You can setup commands or scripts, which will repeatedly run at a set time.
Need of Cron
With reference to Payplans, cron is required to expire subscriptions timely, send pre-expiry, post-expiry emails, get payment from payment gateway etc.
Payplans lets you to set automatic cron run at Payplans Configuration. It will work on all type of hosting servers, like Linux, Windows etc.
Set the Cron Frequency as per the traffic on your site and how frequently you want to execute cron on your site.
In Payplans Configuration, setting Cron Frequency to "Lowest" will exucute cron in every 60 minutes. Low , Normal and High frequency will execute cron in 30 minutes, 15 minutes and 5 minutes simultaneously.
When Micro-subscription is enabled in PayPlans Configuration then Cron execution will get 5 times more frequent to the frequency set in the configuration.
Important : Payplans triggers cron according to frequency when your site is continuously accessed from front-end. If your site is not accessed by anyone for 1 day then during that time period cron will not get executed and as soon as someone access your site, Payplans executes the cron and perform all the pending tasks on the basis of last cron execution.
If you don't want cron execution dependencies on site access then you can setup cron manually at your site server.
Setup Cron on Linux or Unix
To edit your crontab file, type the following command at the UNIX / Linux shell prompt:
- run command crontab -e
- Add this in a single line 0,15,30,45 * * * * wget --max-redirect=10 'http://www.YOURDOMAIN.com/index.php?option=com_payplans&view=cron&task=trigger'
- Replace YOURDOMAIN with your domain in step 2.
This will execute cron job in every 15 minutes( i.e. on 0 minute then on 15 minute and so on). You can make changes in the above command to execute cron as per your requirement.
Syntax of Crontab (Field Description)
Your cron job looks as follows for user jobs:
An operator allows you to specifying multiple values in a field. There are three operators:
The above method can be used when you have the proper permissions.
Otherwise you can set the cron from CPanel or Plesk control panel as well.
After login to your CPanel you will be redirected to the home page where you will find an option named Cron jobs, here you can add cron job.
For more details you can refer the documentation.