Support

Admin Tools

#26698 Jotcache CRON not working - could Admin Tools be the reason?

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by dlb on Saturday, 07 January 2017 19:37 CST

BasilC
 I've been trying in vain to get a cron job to run. The cron is supposed to execute a php file that runs the JotCache recache script, which seems to involve crawling through pages on the website.

The cron looks like this:

*/15 * * * * /usr/bin/php-5.6-cli /var/sites/p/???????????.org.uk/public_html/???/???/???/???.php && MAILTO=webmaster@??????????????.org.uk

Do you think something in my Admin Tools configuration might be blocking the cron job?

I tried disabling the agent blocking part of the Admin Tools .htaccess maker, but it didn't make any difference.

I don't even get the emails that are specified in the cron job, and there is nothing in the security exceptions log.

I've configured Admin Tools to provide direct access to the php file.

Grateful for any advice.

Thanks,

Basil

dlb
Basil,

I had an answer for you right up until your last sentence. That should have done it. Just to be clear, in .htaccess Maker, in the Allow direct access to these php files, you need /???/???/???/???.php on a line all by itself. You are starting the path with the root of the site because generally Admin Tools can't see above that.

Even if Admin Tools is blocking the php file, you should still get an email from the CRON job. Are you sure your path to the php file is correct for CRON? Can it see to the root of the server? That is possible, it depends on the setup of your server.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

BasilC
Thanks Dale.

Pretty sure that Admin Tools isn't the problem. I moved the php file out of the public_html part of the directory structure where it would unaffected by Admin Tools or the .htaccess file. Still didn't work, still didn't send email. So next I wrote a very simple php file that writes the time and date to a text file, again outside the public_html area, and set up a cron job. And that does work, but still no email. So it looks as if there is an error occuring with the file I'm trying to execute, but I'm not getting the email with the error message. There must be some misconfiguration at the hosting company's end, so I'll get onto them.

Finally, Admin Tools is great, I wouldn't be without it.

Cheers,

Basil

dlb
If there is anything we can do to help, please let me know.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

BasilC
Thanks Dale,

I finally got it to work this evening. I made two changes and it started working. I then undid one of them and it stopped - but that doesn't necessarily mean that both weren't needed.

The first was to comment out a couple of lines in the php file - this was definitely needed.

The second was to add all the various directories under administrator/components/com_jotcache/ to the Allow direct access including php files section of the Admin Tools .htaccess maker. I haven't yet tried undoing this, so it may turn out to have been unnecessary.

I was also informed by the hosting company that when you set up a cron on their cloud platform you can't be sent emails when they run, meaning you can't see any error messages or success messages. In this particular case Jotcache has its own log, so I can see what's happening.

Many thanks for your advice.

Regards,

Basil

dlb
When you allow php files in administrator/components/com_jotcache/, it allows them in the tree, so you don't have to do separate commands for the subfolders. It is best if you can identify the specific file or folder to minimize the hole you are creating in your armor.

You could try a third party CRON service. Then you would get the feedback you need and may be able to solve the problem on your own CRON service. WebCron is not a free service but they only require a 3 euro deposit to open an account.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

BasilC
Happy New Year and apologies for not replying earlier. I did eventually get the cron job to work and it turned out that Admin Tools wasn't causing the problem.

Thanks for your help and this ticket can now be closed.

Best wishes,

Basil

dlb
Happy New Year to you! I'm glad you got it working.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!