| |
Setup Cron Job Using Cpanel
|
Cron is simply a Linux module that allows you to run a program or script at predetermined times (intervals). Using Cron, you will be able to setup scheduled sending. In Windows, it's called 'Scheduled Task'.
You may need to check with your hosting provider to see if you have Cron access. If you don't have access, you will not be able to run scheduled sending.
Many web hosts provide you a control panel to administer the Cron jobs. This can simplify the setting up of Cron jobs on your web server. In this tutorial, we'll look into cron setup using command line and CPanel. You will need to edit a PHP file first before proceed to setup cron.
(I) Modify PHP File
The PHP file responsibles for schedule and send newsletter is wce.sendcron.php. This file is located in /oneadmin/newsletter directory.
Open the file with your text editor. Look for the $configpath variable at the top of the file. Assign it with the Document Path of your /oneadmin directory, for example '/home/sitename/public_html/oneadmin/'. Now, the $configpath variable should look something like this:
$configpath = "/home/sitename/public_html/oneadmin/";
Tips: You can find the Document Path value from the /oneadmin/config.php file.
Save the wce.sendcron.php file.
(II) Setup Cron Using CPanel
Before you can setup the cron, you will need to find the following paths, and note them down:
- The path to your PHP executable, such as '/usr/bin/php'
- please ask your server administrator for this value.
- The complete path to the wce.sendcron.php file, such as '/home/sitename/public_html/oneadmin/newsletter/wce.sendcron.php'
Tips: Use the Document Path from /oneadmin/config.php file, and add 'newsletter/wce.sendcron.php' to the end.
Now, navigate to your CPanel via the web browser.
- Login to your CPanel, and click on Cron Jobs.
- On the next page, click on the 'Advanced (Unix Style)' button.
- In the Cron Jobs Manager section, enter '0' (zero) to the Minute text field on the first row.
- Type in the following line to Command text field.
/usr/bin/php /home/sitename/public_html/oneadmin/newsletter/wce.sendcron.php >/dev/null
Substitute the path in green to your PHP executable, and the path in orange to the complete path to your wce.sendcron.php file.
- Click on the 'Save' button to save your setting.
|
|
|