Page tree
Skip to end of metadata
Go to start of metadata

Overview

A cron job/scheduled task is a system-side automatic task that can be configured to run for an infinite number of times at a given interval. Cron/scheduled task allows you to schedule a command or a script to run at a specific time of day, or on a specific day of the week or at a particular time of day on a specific day of the month. It allow for scheduling down to the minute and up to an annual event.

Terminology

Icon

The system-side automatic task in Windows operating system is known as Scheduled Task, and in a Linux/Unix operating system is known as Cron Job

Kayako Fusion, Case and Engage operate an internal pseudo cron system which performs things such as POP3/IMAP email fetching, system cleanups, follow-up ticket actions etc. You can see a list of the tasks scheduled in the internal pseudo cron system, here.

However, this internal pseudo cron system cannot continuously run and execute by itself. In order for the internal cron system to execute, a page in the client support interface or staff control panel must be loaded. For a busy support desk, the risk of the internal cron system going stagnant is low.

However, if your support desk is not busy and you use POP3/IMAP e-mail fetching, it is highly recommended that you set up a system-side cron job to frequently load the /cron/index.php page in your Fusion and Case installation.

Setting cron job on Linux/Unix operating systems using command-line interface

The steps to setup a cron job via server command-line interface, for POP3/IMAP email polling, are as follows:

Step:1 Log into the server command line interface.

Icon

You will need root-level permissions for this operation.

Step:2 Confirm if any of the content retrieval programs are installed on the server viz. wget, GET, lynx etc. You need to install any one of the programs to setup the cron job.

Step:3 Edit the crontab configuration file with the following command

Step:4 Insert the mail parser URL in the crontab configuration file, in the following syntax

Icon

For the purpose of this guide we have used the mail parser URL http://simransangha.kayako.com/cron/index.php?/Parser/ParserMinute/POP3IMAP.  You need to replace the support desk URL http://simransangha.kayako.com/ with the URL of your own support desk.
For information on crontab format, click here.

Step:5  Save the crontab file after making the required changes.

The cron job configured in Step 4 will make the mail parser URL to execute after every 10 minutes to poll the POP3/IMAP emails into the support desk.

Icon

If your help desk is configured for secure HTTP access (https:// (https://_)), then you need to configure the cron job with the following parameters:

*/10 * * * * wget  -O /dev/null --no-check-certificate https://simransangha.kayako.com/cron/index.php?/Parser/ParserMinute/POP3IMAP

Icon

A value of 10 minutes is recommended to ensure the server cron runs effectively.

Setting cron job using cPanel version 11

The steps to setup a cron job using server cPanel version 11, for POP3/IMAP email polling, are as follows:

Icon

This guide assumes that the wget command is enabled for your system.

Step:1 Login to your server cPanel.

Step:2 Click on the Cron Jobs icon, under Advanced section of the cPanel home page, as shown

Step:3 You will be directed to the page where you find the option to add a new cron job, as shown

Cron Email

Insert the e-mail address to which the cron output will be sent. It is recommended this field is left blank, otherwise your inbox could fill up very quickly.

Common Settings

This drop down menu provides some common pre-set cron timings. We recommend not to use the pre-set cron settings.

Minute

Select Every 10 minutes from the drop down menu, so that the mail parser URL gets executed after every 10 minutes interval.

Hour

Select Every hour from the drop down menu, so that the mail parser URL gets executed after every hour.

Day

Select Every day from the drop down menu, so that the mail parser URL gets executed every day.

Month

Select Every month from the drop down menu, so that the mail parser URL gets executed every month.

Weekday

Select Every weekday from the drop down menu, so that the mail parser URL gets executed on every weekday.

Command

Insert the mail parser URL along with the wget command here. For example: wget -O /dev/null http://simransangha.kayako.com/cron/index.php?/Parser/ParserMinute/POP3IMAP

Step:4 Click Add New Cron Job to insert this cron job in the system.

The cron job configured in Step 3 will make the mail parser URL to execute after every 10 minutes, and poll the POP3/IMAP emails into the support desk.

Setting cron job using cPanel version 10

Under construction.

Icon
 

Setting cron job using Plesk control panel

The steps to setup a cron job using server Plesk control panel, for POP3/IMAP email polling, are as follows:

Icon

This guide assumes that the wget command is enabled for your system.

Step:1 Login to your server Plesk control panel.

Step:2 Click Domains under General menu on the left hand side of the Plesk home page, and select your help desk domain.

Step:3 Click on Crontab icon, as shown

Step:4 You will be directed to the page where you find the option to add a new cron job, as shown

Switched on

Check this box if you wish this cron to be up and running as soon as you insert it in the system.

Minute

Specify after how many minutes this cron should execute the mail parser script. Insert */10 for the cron to run after every 10 minutes.

Hour

Specify after how many hours this cron should execute the mail parser script. Insert * for the cron to run after every hour.

Day of the Month

Specify the day of the month this cron should execute the mail parser script. Insert * for the cron to run every day of the month.

Month

Specify the month this cron should execute the mail parser script. Insert * for the cron to run every month.

Day of the Week

Specify the day of the week this cron should execute the mail parser script. Insert * for the cron to run every day of the week.

Command

Insert the mail parser URL and wget command here. For example: wget -O /dev/null http://simransangha.kayako.com/cron/index.php?/Parser/ParserMinute/POP3IMAP

Step:5 Click OK to insert the new cron job in the system.

Setting scheduled task on Windows Server 2003

The steps to setup scheduled task on Windows 2003 server to POP3/IMAP email polling, are as follows:

Step:1 Login to your Windows 2003 server.

Icon

You will need Administrative privileges for this operation.

Step:2  Download the wget.exe application for Windows, from here. Place the wget.exe on your server at C:\Windows

Step:3 Access Scheduled Tasks from Start > Control Panel, and click Add Scheduled Task, as shown

Step:4 Click Next on the scheduled task wizard window, and browse to the wget.exe application placed on your server, and select it. Select Daily as the time of execution, a shown, and click Next

Step:5 Select 12:00 AM as the time of execution and click Next.

Step:6 Provide the administrator username/password and click Next. On the next wizard screen, select Advanced option and click Finish.

Step:7 On the Advanced options, select Task configuration tab, as shown

Run

Browse to the wget.exe placed on your server, and insert the mail parser URL after that. The Run field will then have the following contents:
 C:\WINDOWS\wget.exe -q -O nul http://simransangha.kayako.com/cron/index.php?/Parser/ParserMinute/POP3IMAP. Place -q -O nul before the mail parser URL to suppress the on-screen scheduled task output.

Step:8 On the Advanced options, select Schedule configuration tab, and click Advanced, as shown

Check the Repeat Task box and set the interval to 10 minutes and duration to 24 Hours.

Click Ok and apply the settings. The scheduled task will now run the mail parser URL after every 10 minutes to poll the POP3/IMAP emails into the support desk.

Setting scheduled task on Windows Server 2008

The steps to setup scheduled task on Windows 2008 server, for POP3/IMAP email polling, are as follows:

Step:1 Login to your Windows 2008 server.

Icon

You will need Administrative privileges for this operation.

Step:2 Download the wget.exe application for Windows, from here. Place the wget.exe on your server at C:\Windows

Step:3  Access Task Scheduler from Start > Administrative Tools, as shown

Step:4 Click Create Task, as shown

You will be directed to the page where you need to specify the settings for the new scheduled task. This page is further divided into five configurable sections, which are:

  1. General
  2. Triggers
  3. Actions
  4. Conditions
  5. Settings

Settings specific to these sections are explained as follows:

General

Name

Specify a name for this scheduled task.

Description

Provide a short description for this task.

Run whether user is logged on or not

Select this option so that this schedule task should run even if there is no user is logged on this server.

Triggers

Click New to add a new trigger

Settings

Select Daily, so that this task gets executed every day.

Advanced settings

Select "Repeat task every" option, and select "10 minutes" as the time of repetition. The duration must be set to "Indefinitely".

Enabled

Select this option if you wish that this task should be up and running as soon as you insert it.

Actions

Click New to add a new action

Action

Select Start a program as an intended action.

Settings

Browse to the wget.exe application placed on your server, and select it.

Arguments

Specify the mail parser script URL here. For example, http://simransangha.kayako.com/cron/index.php?/Parser/ParserMinute/POP3IMAP. Specify the  -q -O nul option in front of the URL, so as to suppress the on-screen output of the task.

Conditions

Power

Uncheck the option "Start the task only if the computer is on AC power" so that this task should run on AC and DC power alike.

Rest of the settings need not be changed.

Settings

Uncheck the setting "Stop the task if it runs longer than" so that this task should run indefinitely. Rest of the settings need not be changed.

Now, the mail parser script will run indefinitley after every 10 minutes to poll the emails from a POP3/IMAP email account. 

Icon

This single mail parser scheduled task is sufficient for all the email queues inserted in the support desk.

i

  • No labels