Cron Setup

CRON Jobs (Scheduled Tasks in Windows) are used to trigger certain commands periodically. Oempro uses cron jobs extensively to automate some processes such as email sending, auto responder sending and list synchronization.

This guide will describe how to setup both CRON (in *nix/Mac OS X/Linux) and Scheduled Tasks (in Windows) step by step.

Oempro comes with 4 main cron modules.

  1. General processes
  2. Email campaign send engine
  3. Auto responder send engine
  4. List synchronization
If you are going to use the pop3 method for bounce, spam complaints and email request processing you will also have to add bounce, spam and request processing modules to the cron as well.
  • Bounce handling (POP3 method)
  • SPAM complaint handling (POP3 method)
  • Email request handling (POP3 method)

 

Each periodical process in Oempro has been separated into different CRON job commands to maximize the performance and avoid the waiting time until one process gets completed.

Oempro CRON and email piping methods (described in the next chapter) are located under [installation_path]/oempro/cli/ directory:

Oempro CLI Directory

The above screen shows that there are many files under “cli” directory. We will explain each file later on in this chapter.

Setting up cron jobs vary based on your operating system. In this guide, we will explain how to set cron jobs for Linux and Windows operating systems. Please contact your hosting provider to learn more about how to set it on your own hosting environment.

How To Setup CRON Jobs? (*nix, Mac OS X, Linux)

There are two methods for setting up CRONs in Oempro. You need to select the appropriate method based on your server configuration:

  • Command line CRON modules
    This method needs SSH/Telnet access to your server and execute
  • Regular CRON modules
    This method is easier to setup and more compatible with wide range of server (and hosting) types

 

Command Line CRON Modules
Command line compatible cron jobs are located under [oempro directory]/cli/. These CRON modules must be executed with the PHP interpreter on your server:

Type the following command to edit the existing CRON jobs.

crontab –e

Add the following new CRON jobs:

* * * * * php -d safe_mode=off -f /path/to/oempro/cli/send.php >/dev/null
* * * * * php -d safe_mode=off -f /path/to/oempro/cli/sync.php >/dev/null
* * * * * php -d safe_mode=off -f /path/to/oempro/cli/transactional_send.php >/dev/null
* * * * * php -d safe_mode=off -f /path/to/oempro/cli/general.php >/dev/null

Now Save the file and crontab should report – Installing New Crontab

Regular CRON Modules
Web browser compatible cron jobs are located under [oempro_directory]/cli/ and they start with “web_” and “pop3_” prefix:

  • web_send.php
  • web_sync.php
  • web_transactional_send.php
  • web_general.php
  • pop3_bounce.php
  • pop3_fbl.php
  • pop3_requests.php

These CRON jobs must be executed with a web browser (Firefox, Internet Explorer, Safari, etc.) or a command line based browser such as (wget or curl). We suggest using these modules if you are unable to execute command line compatible CRON jobs. They are less affected by your web server configuration and limits.

In order to setup these cron jobs on your web server, login to your server via telnet or SSH and follow these steps:

  1. Type the following command to edit the existing CRON jobs.crontab –e
  2. Add the following new CRON jobs:* * * * * curl -s http://yoursite.com/oempro/cli/web_send.php >/dev/null
    * * * * * curl -s http://yoursite.com/oempro/cli/web_sync.php >/dev/null
    * * * * * curl -s http://yoursite.com/oempro/cli/web_transactional_send.php >/dev/null
    * * * * * curl -s http://yoursite.com/oempro/cli/web_general.php >/dev/null
    * * * * * curl -s http://yoursite.com/oempro/cli/pop3_bounce.php >/dev/null
    * * * * * curl -s http://yoursite.com/oempro/cli/pop3_fbl.php >/dev/null
    * * * * * curl -s http://yoursite.com/oempro/cli/pop3_requests.php >/dev/null
  3. Now Save the file and crontab should report – Installing New Crontab

That’s it – you are done with the CRON setup and the server will execute the three jobs every minute.

How To Setup Scheduled Tasks? (Windows)
The following procedure explains how to setup scheduled tasks for Oempro scheduled tasks in Microsoft Windows operating system.

The scheduled tasks that we will setup will execute the wget command to load Oempro scheduled task modules. The wget command is not available in the default installation of Windows operating system. Therefore, you will need to download wget application and install it before setting up scheduled tasks in Windows.

Downloading and Installing wget

  1. Go to http://xoomer.alice.it/hherold and download wget application for Microsoft Windows
  2. Copy all DLL files to your C:\WINDOWS\system32 directory
  3. Copy wget.exe file to C:\WINDOWS\ directory

There are several wget binaries for Windows. You can select another one by making a search on Google:

http://www.google.com.tr/search?q=wget+windows

Setting Up Scheduled Tasks

  1. Open the Start Menu and click on Control Panel
  2. From the Control Panel, open up Scheduled Tasks
  3. Right click in space
  4. Select New, followed by Scheduled Task
  5. We will name the task as “Oempro Send Engine”
  6. The command we want the scheduled task to run is:
    C:\WINDOWS\wget.exe -q -O NUL http://yoursite.com/oempro/cli/web_send.php
  7. Ensure that the Enabled box is checked
  8. Switch to Schedule tab
  9. Schedule the task to run every minute
  10. Save the task

Repeat this process for the following scheduled tasks:

  • http://yoursite.com/oempro/cli/web_sync.php
  • http://yoursite.com/oempro/cli/web_transactional_send.php
  • http://yoursite.com/oempro/cli/web_general.php
  • http://yoursite.com/oempro/cli/pop3_bounce.php
  • http://yoursite.com/oempro/cli/pop3_fbl.php
  • http://yoursite.com/oempro/cli/pop3_requests.php
What Happens If There’s No CRON Support On The Server?
If you don’t have CRON support on your server or don’t know how to set it, you can use an online service http://www.webbasedcron.com/ to execute your cron jobs.

Setting Up CRON Modules in Plesk
If you have Plesk control panel on your server, setting CRON modules is easier and it will take only a few minutes.

  1. Login to a plesk control panelPlesk Login
  2. Click “Crontabs” icon on your hosting panelScheduled Tasks

     

  3. Click on the system user which is displayed on the screen shown below
    Select the System user
  4. Click “Schedule a Task” iconschedule-a-new-task
  5. Create your first cron job just like in the below screen shotcreate-task

That’s all. Now repeat steps 1-4 for other Oempro CRON modules

Setting Up CRON Modules in cPanel
Setting up CRON jobs in cPanel is just easy as in the Plesk control panel. Follow these easy steps to complete the CRON setup:

  1. Login to your cPanel
  2. Click “Cron jobs” icon under “Advanced” groupcpanel-cron
  3. cPanel will provide you a screen to add new cron job and at the bottom it will list all the existing cron jobs.New Cron Screen
  4. Set your first cron job based on the example in the below screen shot:Cron Job cPanel

That’s all. Now repeat steps 1-4 for other Oempro CRON modules