What are schedulers and their importance in-suitecrm and sugarcrm
Schedulers: We know them as cron jobs at Linux and scheduled tasks at Windows. CRON Job schedulers are the heart of any CRM system because they do automated tasks. Cron schedules are considered reliable and suitable for repetitive tasks like sending drip emails or monthly database pruning.
Automated tasks are key for any business like pulling emails, sending bulk emails, drip SMS or BCC archivers. All of these tasks are possible because of schedulers. They simply perform the automated tasks in the backend.
Important Existing Schedulers in SuiteCRM
- Check Inbound Mailboxes: The purpose of this CRON Job is to check the inbound email inboxes after every one minute. Any new email found will be parsed to the CRM instantly.
- Prune Tracker Tables: This scheduler keeps track of activities of users performed in the edit view, list view, and detail view.
- Prune Database on 1st of Month: When this job is ON, the records that you soft deleted from CRM will be completely deleted from the CRM database as well. Usually, this job runs on a monthly basis and clears out data on the 1st of every month.
- Run Nightly Mass Email Campaigns: This scheduler allows you to run automated mass email campaign
These 4 above are inbuilt in both CRM platforms and very important to keep active.
How to set up a new scheduler
If you want to create a new scheduler via code. Here is the file structure you need to follow.
You will need to create 3 files for this.
That's how files will looks
// this will create a drop option for creating new scheduler
// This is your actual cron job code
// put your code
// drop down label.
$mod_strings[LBL_OUTRIGHT_NEW_CRON_JOB] = ‘outright_new_cron_job’;
As Often As possible Job
Let us learn about jobs which are set for each minute. These each minute jobs must be very much required to run each minute , then only set for each minute. Each minute passes, jobs put additional pressure on the CPU and OS to run them on time , as they are supposed to run as soon as possible. That means we are pretty sure to make them each minute run. So ideally change each minute jobs to 2 minutes if they do not require to run in this way.
How to check if the Cron is running.
Open up any cron job whose status is active and they are supposed to run aopb/asap. Under logs, there must be an entry of today if cron is running each minute.