Digests

using system cron - Digests

using system cron

by neo314 » Tue Feb 12, 2019 6:58 am

I have been struggling to get the system cron or the digest emailing function working at all. I have gone through the instructions. I have manually put out the digest to file and that works, but I cannot get a digest to manually email. The recommended cron command had a permissions problem, but this command throws no errors I can see.

cd "/home/XXXXXX/public_html"; php ./bin/phpbbcli.php cron:run >/dev/null

The mass email function of the BB works, but I can't get the digest to email by manual or cron procedures.

It is hosted on a cPanel, CENTOS 6.10, running PHP 7. PHPBB 3.2.5 with digest 3.2.11

I also saw this in the cron instructions:
Install a task

Installing a task from a MOD is as easy as placing the files in includes/cron/task/<modname>. It will automatically be used.
I don't have a cron directory in the includes directory, but I do have .../ext/phpbbservices/digests/cron/... so am I missing something? Do I need to move this directory or is this out of date information?
Last edited by neo314 on Tue Feb 12, 2019 3:48 pm
neo314
Registered User
Posts: 20
Joined: Thu May 22, 2008 12:09 am

Re: using system cron

by MarkDHamill » Tue Feb 12, 2019 1:20 pm

I'm not sure you need to put the path in quotes. Your path assumes your forum is in your top web folder. Is this true?

I would leave off the redirection to /dev/null for now. This way if there are errors you can see them and it will give clues to troubleshooting them. Make sure output from the cron is set to an email address so you can see the result and troubleshoot based on what it says. You can also use SSH for testing.

You may also need to preface php with its path. Ask your web host if necessary what the full path is if necessary.
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: using system cron

by neo314 » Thu Feb 14, 2019 8:07 pm

I found I needed to use "php-cli" instead of "php" to get it to run. I have not reviewed the code to run the mailer manually, but if it is trying to execute the cron job in the same way as a test that could be the problem.
neo314
Registered User
Posts: 20
Joined: Thu May 22, 2008 12:09 am

Re: using system cron

by MarkDHamill » Thu Feb 14, 2019 8:40 pm

Interesting. Maybe the Wiki on the system cron needs to be updated.
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: using system cron

by neo314 » Thu Feb 14, 2019 9:36 pm

I'd offer to contribute it but I have to review the code first. I think the failure of the manual run is a useful symptom to key in on. The still doesn't work.
neo314
Registered User
Posts: 20
Joined: Thu May 22, 2008 12:09 am

Re: using system cron

by MarkDHamill » Thu Feb 14, 2019 9:45 pm

You might want to try the curl solution because on shared hosting cron often won't execute more than one command.
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: using system cron

by neo314 » Thu Feb 14, 2019 9:56 pm

My fault. I probably wasn't clear. The digest is working with the cron/php solution using php-cli, but if I manually run the mailer that still doesn't work.

In fact, when successfully ran it from the command line, all my test runs that didn't work suddly came through like they eere cued up.
neo314
Registered User
Posts: 20
Joined: Thu May 22, 2008 12:09 am

Re: using system cron

by MarkDHamill » Thu Feb 14, 2019 11:40 pm

You should run the reset mailer function. There's a lot in the FAQs that may be of interest.
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: using system cron

by neo314 » Fri Feb 15, 2019 12:06 am

MarkDHamill wrote:You should run the reset mailer function. There's a lot in the FAQs that may be of interest.
I did. I would revisit it but it the digest is working, so I don't want to mess people's digests up. If I run it an hour that no one receives a digest will any users next digest be impacted?
neo314
Registered User
Posts: 20
Joined: Thu May 22, 2008 12:09 am

Re: using system cron

by MarkDHamill » Fri Feb 15, 2019 1:00 am

Resetting just means that if there was a digest queue, it is gone. Users will get a digest when they are next scheduled to get one based on their digest type and the hour they chose.
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: using system cron

by neo314 » Fri Feb 15, 2019 1:37 am

I see. At the time, the queued items being sent was useful in understanding what was happening. That is how I knew the prior tests had worked to generate the digests, but they did not mail. Since that is a diagnostic tool, it might be worthwhile to have it output messages for each step to help identify where and why any failure occurs.

When I took out >/dev/null, the message was that this command has to be run from the command line. That led me to run it from the command line and then investigate why it would run in shell but not in cron which led to the php-cli solution. It is running on CentOS6 cPanel.
neo314
Registered User
Posts: 20
Joined: Thu May 22, 2008 12:09 am

Re: using system cron

by MarkDHamill » Fri Feb 15, 2019 2:02 am

Thanks. The Wiki did not actually show php before ./bin/phpbbcli.php cron:run. I corrected this and based on your experience also suggested php_cli command if php doesn't work.

https://wiki.phpbb.com/PhpBB3.1/RFC/Mod ... ystem_cron
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: using system cron

by neo314 » Fri Feb 15, 2019 2:25 am

Thumbs up!
neo314
Registered User
Posts: 20
Joined: Thu May 22, 2008 12:09 am

Re: using system cron

by MarkDHamill » Sat Feb 16, 2019 12:47 am

neo314 wrote:My fault. I probably wasn't clear. The digest is working with the cron/php solution using php-cli, but if I manually run the mailer that still doesn't work.
The manual mailer will send emails for one hour only, so it won't mess up the regular digest mailer. Typically it is the current hour, but can be set to any day or hour. There should be evidence of the manual mailer working in the Admin log if digest logging is turned on. Both ways simply hand over the mailing to phpBB's emailing interface, so it should go out either way.
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