define("MAILQUEUE_BATCH_SIZE",300);
# define the length of one batch processing period, in seconds (3600 is an hour)
define("MAILQUEUE_BATCH_PERIOD",3600);
Balitas wrote:The problem is it sends and average of 300 emails per hour, and then finish (and not send all the emails to my 2600 subscribers)
Cron job with batch processing (PHP-cgi)
- Code: Select all
#=================================================================
# CRON JOB with batch mode on - (PHP-cgi)
# crontab for processing all messages with status 'queued' or 'inprocess'.
# Processing starts at 17 min after midnight and continues for 3 hours with
# a reload after one hour. The hour of the cron schedule as well as the
# reload count has to be increased by 1 for each crontab entry.
# Maximal MAILQUEUE_BATCH_SIZE * NUMBER_OF_CONTRAB_ENTRIES emails will be send.
# In this example is NUMBER_OF_CRONTAB_ENTRIES=4.
#=================================================================
17 0 * * * wget -q -O - 'http://www.mydomain.com/lists/admin/index.php?page=processqueue&login=myusername&password=mypassword&reload=0' >/dev/null
17 1 * * * wget -q -O - 'http://www.mydomain.com/lists/admin/index.php?page=processqueue&login=myusername&password=mypassword&reload=1' >/dev/null
17 2 * * * wget -q -O - 'http://www.mydomain.com/lists/admin/index.php?page=processqueue&login=myusername&password=mypassword&reload=2' >/dev/null
17 3 * * * wget -q -O - 'http://www.mydomain.com/lists/admin/index.php?page=processqueue&login=myusername&password=mypassword&reload=3' >/dev/null
This cron job uses wget and therefore you have to set one entry for each increasing reload. The number of entries multiplied with MAILQUEUE_BATCH_SIZE must be higher than the number of subscribers to that list (assuming the message will be send only to one list). You have to add additional entries when the list grows. To calculate the time between the schedules see at how to tune MAILQUEUE_BATCH_SIZE. (Each schedule has to be in one line.)
Source: http://docs.phplist.com/CronJobExamples
curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=0
curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=1
curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=2
curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=3
curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=4
curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=5
curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=6
curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=7
curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=8
curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=0
curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=1
#==============================================================================
#================ CRON JOB with batch mode on - (PHP-cgi) =====================
#
# crontab for processing all messages with status 'queued' or 'inprocess'.
# Processing starts at 17 min after midnight and continues for 9 hours with
# a reload after one hour.
#
# The hour of the cron schedule and the reload count has to be increased by 1
# for each crontab entry, i.e. for each batch you need to process.
#
# Settings in config.php:
# define("MAILQUEUE_BATCH_SIZE",300);
# define("MAILQUEUE_BATCH_PERIOD",3600);
# define('MAILQUEUE_THROTTLE',4);
#
#==============================================================================
17 0 * * * curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=0 >/dev/null
17 1 * * * curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=1 >/dev/null
17 2 * * * curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=2 >/dev/null
17 3 * * * curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=3 >/dev/null
17 4 * * * curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=4 >/dev/null
17 5 * * * curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=5 >/dev/null
17 6 * * * curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=6 >/dev/null
17 7 * * * curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=7 >/dev/null
17 8 * * * curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=8 >/dev/null
I was under the (wrong) assumption that you had succefully tested curl. I probably misread one of the previous posts.Balitas wrote:SECOND QUESTION:
I was working fine with help of evidenthost with wget, is the same of curl?
Well, that depends why you want it to go on sending batches in sequence for 24 hours. If you are sending a total message load of 7200 messages (300 messages x 24 hours) this would be alright. But I'm not sure that's you want to do. It might help if you'd explain that point.Balitas wrote:FIRST QUESTION: If I want this 24 hours day I need to put
17 8 * * * curl -s http://www.example.com/lists/admin/?page ... D&reload=8 >/dev/null
until
17 23 * * * curl -s http://www.example.com/lists/admin/?page ... D&reload=8 >/dev/null
Right?
#==============================================================================
#================ CRON JOB with batch mode on - (PHP-cgi) =====================
#
# crontab for processing all messages with status 'queued' or 'inprocess'.
# Processing starts at 17 min after midnight and continues for 9 hours with
# a reload after one hour.
#
# The hour of the cron schedule and the reload count has to be increased by 1
# for each crontab entry, i.e. for each batch you need to process.
#
# a new sequence of batches does not need a reload count as long as their number
# is lower than the batch size.
#
# Settings in config.php:
# define("MAILQUEUE_BATCH_SIZE",300);
# define("MAILQUEUE_BATCH_PERIOD",3600);
# define('MAILQUEUE_THROTTLE',4);
#
#==============================================================================
17 0 * * * wget -q -O - http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=0 >/dev/null
17 1 * * * wget -q -O - http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=1 >/dev/null
17 2 * * * wget -q -O - http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=2 >/dev/null
17 3 * * * wget -q -O - http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=3 >/dev/null
17 4 * * * wget -q -O - http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=4 >/dev/null
17 5 * * * wget -q -O - http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=5 >/dev/null
17 6 * * * wget -q -O - http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=6 >/dev/null
17 7 * * * wget -q -O - http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=7 >/dev/null
17 8 * * * wget -q -O - http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD&reload=8 >/dev/null
17 9 * * * wget -q -O - http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD >/dev/null
17 10 * * * wget -q -O - http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD >/dev/null
...... etc ....
17 23 * * * wget -q -O - http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD >/dev/null
Return to Advanced Answers, Howtos, Tips & Tricks
Users browsing this forum: No registered users and 0 guests