Warning: The author of this contribution does not provide support for it anymore.

phpBB Digests

CRON job in a loop :-/ - phpBB Digests

CRON job in a loop :-/

by topsboss » Tue Jan 20, 2015 10:30 am

Hi,

Forgive me for my naivety - I am an absolute beginner at all of this and I am at the limit of my understanding.

I have successfully installed the excellent Digests mod and tested it by running mail_digests.php directly. All worked fine.

I set up a CRON job using cPanel with the following command :

Code: Select all

curl http://www.topsmusicals.co.uk/forum/mail_digests.php


It was set to run once a day at 6am (see screenshot). At 6am it ran successfully, but then it ran again every 60 seconds after that for about 15 minutes until I stopped the CRON job (by deleting it in cPanel - I didn't know any other way).

I'm not sure what other information I should be providing here to seek some advice but I would be glad of any pointers you can give me. My service provider has simply responded with 'server management is down to you, we can't help'. Great.

Other things that I think might be useful to know:
I am running phpBB v3.0.12
Digests reports it is the latest version
My VPS has the following configuration: CENTOS 6.6 x86_64, WHM 11.44.2 (build 4)
Server time and time zone is correct.

Here is the CRON report for the last time the task was run. I'm sorry but I haven't figured out how to read this report yet.

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0
100 3318 0 3318 0 0 652 0 --:--:-- 0:00:05 --:--:-- 819
100 3318 0 3318 0 0 650 0 --:--:-- 0:00:05 --:--:-- 1082
<strong>Starting mail_digests.php</strong><br /><strong>A digest was sent to Ian . . . . . [this portion edited to remove user names etc] strong>Ending mail_digests.php</strong><br />

The reports from the other 16 times the job was run differ slightly in the last line before the user details. Here is an example.

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0
100 3318 0 3318 0 0 772 0 --:--:-- 0:00:04 --:--:-- 775

Sorry, clutching at straws here - not sure if any of that is useful!

Can anyone help? I'm reluctant to attempt this again as I have had numerous complaints from users this morning, understandably moaning about getting 17 duplicate emails!

Thanks in advance of any guidance and apologies again if this is all down to user incompetence!

Ian . . .
Attachments
cron-prob.jpg
topsboss
Registered User
Posts: 4
Joined: Tue Jan 20, 2015 10:00 am

Re: CRON job in a loop :-/

by MarkDHamill » Tue Jan 20, 2015 8:58 pm

You programmed the cron job to run once a minute for the sixth hour of the day. The cron should be programmed to run once an hour, and only once an hour, every day. So the fields would be something like this:

0 * * * *

You might want to look at the readme.html file in the /contrib folder of the archive. It is linked from the install.xml file. It discusses all of this in detail.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: CRON job in a loop :-/

by topsboss » Tue Jan 20, 2015 11:54 pm

Thanks for such a quick reply Mark. I will absolutely look at the readme file again. To be honest, I still can't see the once a minute bit! I will investigate further but again, I appreciate your guidance.
topsboss
Registered User
Posts: 4
Joined: Tue Jan 20, 2015 10:00 am

Re: CRON job in a loop :-/

by topsboss » Wed Jan 21, 2015 12:07 am

OK, I see it now. I hadn't appreciated the wildcard was 'repeat for each time unit'. So in my case, to get it to run at 7am every day I have used 0 7 * * *. Thanks for gently reminding me to read the notes more carefully.
topsboss
Registered User
Posts: 4
Joined: Tue Jan 20, 2015 10:00 am

Re: CRON job in a loop :-/

by MarkDHamill » Wed Jan 21, 2015 12:09 am

The way digests work it must run once an hour for every hour. Users choose the hour they want to get their digest. If there is nothing going out for a particular hour, it will quickly shut down.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: CRON job in a loop :-/

by topsboss » Wed Jan 21, 2015 8:51 am

Yep, when I read the instructions for the ninth time I realised I had made a mistake again. The piece I was not getting was the fact that the users choose the hour, non the cron job. I thought both had to match. All now working correctly. Again, grateful for your patient help for a complete novice.
topsboss
Registered User
Posts: 4
Joined: Tue Jan 20, 2015 10:00 am