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. 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. It is highly recommended that you set up a system-side cron job to frequently load the following cron/*.php page which are as follows: 1. http://website.com/wp-content/plugins/webinar_plugin/webinarcrons/send_email_cron.php 2. http://website.com/wp-content/plugins/webinar_plugin/webinar-crons/ get_webinar_notification_cron.php System-side cron jobs can be set up for the following: 1. Setting cron job Linux/Unix operating systems using command-line interface. 2. Setting Cron job using cpanel version 11. 3. Setting Cron job using Plesk control Panel version 11. 4. Setting scheduled task on windows server 2008.
Setting cron job Linux/Unix operating systems using command-line interface The steps to setup a cron job via server command-line interface are as follows: Step:1 Log into the server command line interface. 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 # crontab -e Step:4 Insert the URL in the crontab configuration file, in the following syntax */5 * * * * wget -O /dev/null http://website.com/wpcontent/plugins/webinar_plugin/webinar-crons/send_email_cron.php If your help desk is configured for secure HTTP access (https://), then you need to configure the cron job with the following parameters: */5 * * * * wget -O /dev/null --no-check-certificate https://website.com/wpcontent/plugins/webinar_plugin/webinar-crons/send_email_cron.php The cron job configured in Step 4 will make the URL to execute after every 5 minutes. Repeat the steps to insert the following URL in crontab configuration file for notifications http://website.com/wp-content/plugins/webinar_plugin/webinar-crons/ get_webinar_notification_cron.php
Setting Cron job using cpanel version 11 The steps to setup a cron job using server cpanel version 11 are as follows 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 Minute Hour Day Month Weekday This drop down menu provides some common pre-set cron timings. We recommend not to use the pre-set cron settings. Select Every 5 minutes from the drop down menu, so that the URL gets executed after every 5 minutes interval. Select Every hour from the drop down menu, so that the URL gets executed after every hour. Select Every day from the drop down menu, so that the URL gets executed every day. Select Every month from the drop down menu, so that the URL gets executed every month. Select Every weekday from the drop down menu, so that the URL gets executed on every weekday. Command Insert the URL along with the wget command here. For example: wget -O /dev/null http://website.com/wp-content/plugins/webinar_plugin/webinarcrons/send_email_cron.php 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 URL to execute after every 5 minutes. Repeat the steps to insert the following URL in crontab configuration file for notifications http://website.com/wp-content/plugins/webinar_plugin/webinar-crons/ get_webinar_notification_cron.php
Setting Cron job using Plesk control Panel version 11 The steps to setup a cron job using server Plesk control panel are as follows 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 Hour Day of the Month Month Day of the Week Specify after how many minutes this cron should execute the script. Insert */5 for the cron to run after every 5 minutes. Specify after how many hours this cron should execute the script. Insert * for the cron to run after every hour. Specify the day of the month this cron should execute the script. Insert * for the cron to run every day of the month. Specify the month this cron should execute the script. Insert * for the cron to run every month. Specify the day of the week this cron should execute the script. Insert * for the cron to run every day of the week. Command Insert the URL and wget command here. For example: wget -O /dev/http://website.com/wp-content/plugins/webinar_plugin/webinarcrons/send_email_cron.php Step:5 Click OK to insert the new cron job in the system. Repeat the steps to insert the following URL in crontab configuration file for notifications http://website.com/wp-content/plugins/webinar_plugin/webinar-crons/ get_webinar_notification_cron.php
Setting scheduled task on windows server 2008 The steps to setup scheduled task on Windows 2008 server are as follows: Step:1 Login to your Windows 2008 server. 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: Name Description Run whether user is logged on or not Specify a name for this scheduled task. Provide a short description for this task. 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 Advanced settings Enabled Select Daily, so that this task gets executed every day. Select "Repeat task every" option, and select "5 minutes" as the time of repetition. The duration must be set to "Indefinitely". 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 script URL here. For example, http://website.com/wpcontent/plugins/webinar_plugin/webinar-crons/send_email_cron.php. Specify the -q -O nul option in front of the URL, so as to suppress the onscreen output of the task.
Conditions
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. Repeat the steps to insert the following URL in crontab configuration file for notifications http://website.com/wp-content/plugins/webinar_plugin/webinar-crons/ get_webinar_notification_cron.php Now, the URL script will run indefinitely after every 5 minutes.