Cron Jobs run scheduled tasks at specific times. This is good to set up automated maintenance and other unmanned server duties.
To create a cron job, please do the following:
- Click on the "Cron Jobs" icon inside cPanel, under Advanced.
- Make sure the current email address is valid. If not, enter a new email and click the "Update Email" button.
- Select the Common Setting you want. This will automatically change the other time settings.
- Alternatively, you may adjust the individual time settings. Minute, Hour, Day, Month and Weekday can be modified to achieve your goal.
- In the input box to the right of "Command", type the name of the file type, then add a space and provide the path to the file which you would like the command to run.
- Click the "Add New Cron Job" button.
You have just created a cron job to execute a file at a certain time and date with the desired repetition.
Cron jobs are easy to edit and delete.
- Click on the "Cron Jobs" icon inside cPanel.
- Scroll down to the last section called "Current Cron Jobs".
- Find the correct cron job and click either "Edit" or "Delete", under Actions.
- Editing does not have the nice automated tools, so it may be easier to copy the Command, delete the cron job, and recreate it.



cPanel is a popular web hosting control panel that helps you manage your hosting account and assists you in creating web sites, managing e-mail addresses, & installing applications to a server.
First, create a file called crontab.php, and put it in your PHP List root folder. In the following example, I named my folder phplist, & placed it in the main public_html folder in my account. This makes it accessible via my top main domain on the account (of course, if you want it on a subdomain, you can do that too, and just change the address of the script to suit.) Put the following code in this file, replace YOURDOMAIN with your domain, replace LOGIN and PASSWORD with your PHP List login & Password, and CHMOD the file to 755:
<?php
include('http://www.YOURDOMAIN.com/phplist/admin/?page=processqueue&login=LOGIN&password=PASSWORD');
?>
Now, go into your cPanel under Advanced and click Cron Jobs. First enter a special email address you create just for the purpose of monitoring this list. It should correspond to the "Who gets the reports" email you set up in your PHP List Main Configuration page dialogue.
Next, for the time schedule, Select Common Settings, Once an Hour.
Enter this in the "Command" text box:
php /home/USER/public_html/phplist/crontab.php
Replace USER with your account username.
Click "Add New Cron Job" button.
Open up the PHP List config file located at: phplist/config/config.php.
Edit and save these values as follows:
define("MAILQUEUE_BATCH_SIZE",400)
define("MAILQUEUE_BATCH_PERIOD",3600);
define('MAILQUEUE_THROTTLE', 6);
This sets it to run once an hour, send out 400 emails, timed 6 seconds apart.
Obviously, if you've read the PHP List documentation and understand what any of these values are doing, including the cron scheduling in cPanel, you can adjust them. But this is the general idea for a combination of settings that will work.
For example, to test that it's all working, I would set the cron job minutes to a few minutes ahead, then wait to see if it everything was working. EG, if it was 8:15, I would set the scheduler to 20 minutes after the hour, on every hour, day, month, weekday, then wait a couple of minutes to see if it would work.
How do you know? Check the email address you set up to receive reports at. You should get a message fro the Cron Daemon as well as PHP List.
Also, check the phplist_usermessage table in your phplist database. Every time an email goes out, it registers in this table, so you should see the value going up from where it started (have this set up to start with, then refresh the browser to reload the database--and reload a few times and see if the number goes up: it should always equal the number of messages sent)>
Well, I hope this helps someone else (cause it took me a bunch of hours to figure out...) :-)