Cron job walkthrough

Solutions for other advanced phplisters

Cron job walkthrough

Postby Balitas » 4:08pm, Thu 16 Nov, 2006

Please guys help me.

I setup php list to send no more than 350 message per hour:

# define the amount of emails you want to send per period. If 0, batch processing
# is disabled and messages are sent out as fast as possible
define("MAILQUEUE_BATCH_SIZE",10);

# define the length of one batch processing period, in seconds (3600 is an hour)
define("MAILQUEUE_BATCH_PERIOD",120);

# to avoid overloading the server that sends your email, you can add a little delay
# between messages that will spread the load of sending
# you will need to find a good value for your own server
# value is in seconds (or you can play with the autothrottle below)
define('MAILQUEUE_THROTTLE',10);

With this configuration phplist send 10 message in two minutes, with 10 seconds of difference between messages.

All works fine, but I have 2000 subscribers, and phplist send only the messages in the first two minutes and then stops.

I want to continue sending message every 2 minutes without stoping an finish in 2000 subscriber.

HOW COULD I DO IT!!!!
Need a website? Enter to www.balitas.com
Balitas
PL Geek
 
Posts: 82
Joined: 2:17am, Mon 13 Feb, 2006

Postby H2B2 » 6:03pm, Thu 16 Nov, 2006

Perhaps you should setup a cron job.

Ref:
- The three interfaces of PHP
- Setting up cron jobs
- Cron job examples
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby grant » 8:59pm, Thu 16 Nov, 2006

i am having a similar problem, but can't figure out the cron job thing.

any more basic instructions than the ones you linked to already?

thanx
grant
phpList newbie
 
Posts: 1
Joined: 4:42pm, Wed 18 Oct, 2006

Postby H2B2 » 12:03am, Fri 17 Nov, 2006

grant wrote:any more basic instructions than the ones you linked to already?
Not really. You could take a look at this page though: http://docs.phplist.com/ProcessQueueInfo

Or perhaps you can search the forum for 'cron'.
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby Balitas » 4:35am, Sat 18 Nov, 2006

Please help us with an example for dumb :)
Need a website? Enter to www.balitas.com
Balitas
PL Geek
 
Posts: 82
Joined: 2:17am, Mon 13 Feb, 2006

Postby evidenthost » 5:39am, Sat 18 Nov, 2006

Cron commands depend on your server settings.
You may test one of the followings.

Code: Select all
curl -s http://www.domain.com/lists/admin/?page=processqueue&login=USERNAME&password=PASSWORD


Code: Select all
php -q /home/USERNAME/public_html/lists/admin/index.php?page=processqueue&login=USERNAME&password=PASSWORD


Code: Select all
wget -q -O - /home/USERNAME/public_html/lists/admin/index.php?page=processqueue&login=USERNAME&password=PASSWORD


Edit your username, password, and url/folder etc. then test them. note that username in /home/USERNAME/public_html/ is your hosting account username. and in your &login=USERNAME is your phplist username.

Set cron to run every two minutes. you should receive a cron email, look into it to see what cron says? let me know that, then I help you further.
evidenthost
PL Nut
 
Posts: 27
Joined: 3:58am, Fri 17 Nov, 2006
Location: Canada - West Vancouver

Postby evidenthost » 8:15am, Sat 18 Nov, 2006

I did not read the source, so I am not pretty sure about this but I guess, login box is using post method rather than get method to post username and password to the script to login. so if this is a post method, I don't think you can pass the username and password via url to your script, if register_globals is off. see your phpinfo() if your register_globals is off or on?
evidenthost
PL Nut
 
Posts: 27
Joined: 3:58am, Fri 17 Nov, 2006
Location: Canada - West Vancouver

Postby Balitas » 5:01am, Sun 19 Nov, 2006

I don't understand sorry, please explain as much you can, for a dumb user.

Please indicate which files I need to modify.

Regards.
Need a website? Enter to www.balitas.com
Balitas
PL Geek
 
Posts: 82
Joined: 2:17am, Mon 13 Feb, 2006

Postby evidenthost » 5:12am, Sun 19 Nov, 2006

Before taking any step to setup cron, let's do this test. log OUT from your admin panel of phplist, go to Tools ->Internet Options of your IE, then delete all cookies, History, and all files, and close all windows.

Then go to this url directly via your browser, and see if it works?

http://www.example.com/lists/admin/?page ... d=PASSWORD

please edit and reflect the url above with your own url, correct foldername to your phplist and edit username and password of your phplist in the url, then run it and tell me what happens? if this is okay, you should see your process queue page?
evidenthost
PL Nut
 
Posts: 27
Joined: 3:58am, Fri 17 Nov, 2006
Location: Canada - West Vancouver

Postby Balitas » 5:20am, Sun 19 Nov, 2006

Yes I see the process queue page, which is the next step?
Need a website? Enter to www.balitas.com
Balitas
PL Geek
 
Posts: 82
Joined: 2:17am, Mon 13 Feb, 2006

Postby evidenthost » 5:35am, Sun 19 Nov, 2006

It means that you can setup cron for your phplist. no worries! :)

Login to your CPanel, click on "Cron Job" icon, there is two options, 'standard', 'advanced (linux)', click 'advanced (linux)'
you will see some boxes to define the time.
* means every.
so if you want to run your cron once per day on 23:55
you should set:
23 for hours, 55 for minutes, * for days (means every day), * for month, * for year.

then next to it there is text line for cron command, commands are varies from server to server.
try all of the commands I told you in my previes post to see which one works for you.

for test purposes, you'd better to set the time for ****** (means every minute of every hour on every day of every month of every year) that you won't wait until 23:55! :-)

do not forget to edit the commands to reflect your url and foldername of your phplist. in my previous post I gave you three commands, test one of them, if it doesn't work you should receive an error email, tell me what are in the emails you got from cron?


note that USERNAME before /public_html/ is your hosting account username, only login=USERNAME is your phplist username.

tell me what happens.
evidenthost
PL Nut
 
Posts: 27
Joined: 3:58am, Fri 17 Nov, 2006
Location: Canada - West Vancouver

Postby Balitas » 5:50am, Sun 19 Nov, 2006

Ok I understand the cron system, but before to put the command, which command I need to put? Do you mean http://www.example.com/lists/admin/?page ... d=PASSWORD

I don't understand this part :(
Need a website? Enter to www.balitas.com
Balitas
PL Geek
 
Posts: 82
Joined: 2:17am, Mon 13 Feb, 2006

Postby evidenthost » 5:58am, Sun 19 Nov, 2006

add one of the followings before the url you gave me.
curl -s http://blah.....

if doesn't work then test this command

php -q /home/USERNAME/public_html/lists/admin/index.php?page=processqueue&login=USERNAME&password=PASSWORD

if it doesn't work then test this one:

wget -q -O - /home/USERNAME/public_html/lists/admin/index.php?page=processqueue&login=USERNAME&password=PASSWORD

edit them to reflect your own username or url, complete url is only with curl -s
but if you want to use php -q or wget -q -O you will need to have the server path /home/USERNAME/public_html/FOLDER_NAME_TO_PHPLIST/....

note username before /public_html/ is your hosting account username and not the phplist username. username of your phplist is reflected in &login=USERNAME
evidenthost
PL Nut
 
Posts: 27
Joined: 3:58am, Fri 17 Nov, 2006
Location: Canada - West Vancouver

Postby Balitas » 6:02am, Sun 19 Nov, 2006

Ok I understand, but before proceed, in which moment I will know which command will work?
Need a website? Enter to www.balitas.com
Balitas
PL Geek
 
Posts: 82
Joined: 2:17am, Mon 13 Feb, 2006

Postby Balitas » 6:05am, Sun 19 Nov, 2006

I put the first one and I receive one email each minute, what does it mean?
Need a website? Enter to www.balitas.com
Balitas
PL Geek
 
Posts: 82
Joined: 2:17am, Mon 13 Feb, 2006

Next

Return to Advanced Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 1 guest

cron