TOPIC: Cron job not working

Cron job not working 05 Dec 2016 23:53 #1837

I've been trying to get a cron job to work running cron_recache.php. However, it doesn't seem to work.

If it is working, would its operation be recorded in the jotcache.recache.log?

On my host's control panel I can see the cron log showing that the file was executed, for example Dec 5 21:47:41 cron2-lxc crond[24195]: (xxxxx) CMD (/usr/bin/php-5.6-cli q /var/sites/p/xxxxxxx.org.uk/public_html/xxxxx/xxxxx/xxxxx.php). However, it doesn't seem to have done anything.

I've configured the file as follows:

define('JPATH_BASE', '/var/sites/p/xxxxxxx.org.uk/public_html/pgc');
define('JOTCACHE_ROOT_URL', 'www.xxxxxxx.org.uk/pgc');
define('JOTCACHE_PLUGIN_NAME', 'crawler');

I've configured admin tools to generate a .htaccess file that allows direct access to the cron recache file. I've set the file permissions as 0755

Can you see any reason why it might not be working?

Thanks in advance for your help.

Basil

Joomla version : 3.6
JotCache version : 5.3
site template: Shape6 BusinessPro + jtouch3 for mobile
system plugins : Too many to list, but they include CacheControl
The administrator has disabled public write access.

Cron job not working 06 Dec 2016 09:33 #1838

If it is working, would its operation be recorded in the jotcache.recache.log?
Yes.

Set cron job for output to the e-mail and look if you have any error listed as
[JotCache recache] cron script error : ....
If No errors then temporary disable URL filter in Security section on Advanced tab of JotCache plugin.

Run again. Here are expected some results in jotcache.recache.log.php
The administrator has disabled public write access.

Cron job not working 06 Dec 2016 23:53 #1839

I've added a MAILTO address and removed the -q but it hasn't sent me any emails.

I wonder if Admin Tools is blocking the cron job? The .htaccess maker blocks the following agents:

WebBandit
webbandit
Acunetix
binlar
BlackWidow
Bolt 0
Bot This email address is being protected from spambots. You need JavaScript enabled to view it.
BOT for JCE
casper
checkprivacy
ChinaClaw
clshttp
cmsworldmap
comodo
Custo
Default Browser 0
diavol
DIIbot
DISCo
dotbot
Download Demon
eCatch
EirGrabber
EmailCollector
EmailSiphon
EmailWolf
Express WebPictures
extract
ExtractorPro
EyeNetIE
feedfinder
FHscan
FlashGet
flicky
GetRight
GetWeb!
Go-Ahead-Got-It
Go!Zilla
grab
GrabNet
Grafula
harvest
HMView
ia_archiver
Image Stripper
Image Sucker
InterGET
Internet Ninja
InternetSeer.com
jakarta
Java
JetCar
JOC Web Spider
kmccrew
larbin
LeechFTP
libwww
Mass Downloader
Maxthon$
microsoft.url
MIDown tool
miner
Mister PiX
NEWT
MSFrontPage
Navroad
NearSite
Net Vampire
NetAnts
NetSpider
NetZIP
nutch
Octopus
Offline Explorer
Offline Navigator
PageGrabber
Papa Foto
pavuk
pcBrowser
PeoplePal
planetwork
psbot
purebot
pycurl
RealDownload
ReGet
Rippers 0
SeaMonkey$
sitecheck.internetseer.com
SiteSnagger
skygrid
SmartDownload
sucker
SuperBot
SuperHTTP
Surfbot
tAkeOut
Teleport Pro
Toata dragostea mea pentru diavola
turnit
vikspider
VoidEYE
Web Image Collector
Web Sucker
WebAuto
WebCopier
WebFetch
WebGo IS
WebLeacher
WebReaper
WebSauger
Website eXtractor
Website Quester
WebStripper
WebWhacker
WebZIP
Wget
Widow
WWW-Mechanize
WWWOFFLE
Xaldon WebSpider
Yandex
Zeus
zmeu
CazoodleBot
discobot
ecxi
GT::WWW
heritrix
HTTP::Lite
HTTrack
ia_archiver
id-search
id-search.org
IDBot
Indy Library
IRLbot
ISC Systems iRc Search 2.1
LinksManager.com_bot
linkwalker
lwp-trivial
MFC_Tear_Sample
Microsoft URL Control
Missigua Locator
panscient.com
PECL::HTTP
PHPCrawl
PleaseCrawl
SBIder
Snoopy
Steeler
URI::Fetch
urllib
Web Sucker
webalta
WebCollage
Wells Search II
WEP Search
zermelo
ZyBorg
Indy Library
libwww-perl
Go!Zilla
TurnitinBot

Perhaps the crawler is mistaken for one of the above listed?

Basil
The administrator has disabled public write access.

Cron job not working 11 Dec 2016 20:37 #1844

I definitely have the correct path specified in the cron job - I tested this by creating a cron running a simple test php script in the same directory. However, I don't receive emails either from this job or from the Jotcache job. I've now been told by my hosting company TSOhost that their cloud platform doesn't send emails.

Evidently there is something going wrong with the cron_recache.php file. Is there any other way of receiving the error messages apart from email? Or could I add something to cron_recache.php which would send me an email with the error message?
The administrator has disabled public write access.

Cron job not working 12 Dec 2016 09:33 #1845

When you cannot use mail from cron output then you can write cron_recache.php messages into some dedicated log. Change slightly cron_recache.php code on the end of file content in following way:
if (file_exists($flagPath)) {
    unlink($flagPath);
  }
  file_put_contents('/var/...../logs/cron_log.txt', '[JotCache recache] cron script finished successfully.'.PHP_EOL, FILE_APPEND);
} catch (Exception $e) {
  // An exception has been caught, echo the message.
  file_put_contents('/var/...../logs/cron_log.txt', '[JotCache recache] cron script error : '.$e->getMessage().PHP_EOL, FILE_APPEND);
  exit('[JotCache recache] cron script error : '.$e->getMessage());
}
where string
'/var/...../logs/cron_log.txt'
have to be adjusted on your server (as the hint look on Joomla logs path in configuration).
The administrator has disabled public write access.
Time to create page: 0.268 seconds
We have 108 guests and one member online
Copyright © 2015 JotComponents
We have 108 guests and one member online
Copyright © 2018 JotComponents