Hello,
I'm currently trying to set up a cron job for the product export.
I've read the documentation, enabled the corresponding template for cron and entered a scret there.
With our provider I used the following command (where XXXX is the secret I've entered):
var/www/..../cli/joomla.php rocsvi:export --template_id=3 --key=XXXXXX
Unfortunately the export file is not created (manual export runs fine).
I've checked the path for joomla.php, that should be fine. Is that command generally correct? Or do I need a further parameter for the export file?
Thanks, Petra
Hello Petra,
var/www/..../cli/joomla.php rocsvi:export --template_id=3 --key=XXXXXX
The cron command looks fine but you are missing PHP executable path in the command. Usually the path is /usr/local/bin/php but you need to check with your hosting on actual path. With PHP executable path the complete cron command would be
/usr/local/bin/php var/www/..../cli/joomla.php rocsvi:export --template_id=3 --key=XXXXXX
Check with this change and let us know.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Hi Tharuna,
in the backend of our provider the php executable does't have to be entered (if I understood it correctly).
Instead you select the script version from a drop down list.
I will clarify that with our provider and will let you know.
Best regards,
Petra
Hello again,
I have to get back to you as I really got stuck here.
I've talked to our provider and they say that the cronjob is up and running. Nevertheless the export file isn't written (only for the manual
calls in the backend of Joomla).
So there must be something wrong with my setup I guess. Either in the template specifications or in the parameters of
the cronjob.
Is there anything else I could do to see where the cronjob goes wrong? Carry out any tests?
Any suggestions would be appreciated.
Thanks,
Petra
Hello Petra,
Nevertheless the export file isn't written (only for the manual
calls in the backend of Joomla).
Export does not work when running manually on the backend?
So there must be something wrong with my setup I guess. Either in the template specifications or in the parameters of
the cronjob.
Did you add PHP executable path to the cron command as mentioned in my previous reply?
Is there anything else I could do to see where the cronjob goes wrong? Carry out any tests?
You can add email to cron output and if there are any errors with cron job. You can add the email in CPanel on your server. You can also run the cron command using CLI on your server and check.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Hi Tharuna,
thanks for your reply.
The export does work fine if called in the backend. It only doesn't work with the cronjob.
We have a shared hosting and no cpanel. So we can't use cli or add email to cron output.
In the backend of our provider I also can't add the path to the PHP executable as that is determined
automatically by a drop down where you select the script version. And as our provider confirmed
the cronjob is running and there are no errors.
Kind regards,
Petra
Hello Petra,
And as our provider confirmed
the cronjob is running and there are no errors.
But export does not create the file? Post the export debug log of the cron to check. To get the debug log see How to collect debug information? document.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Hi Tharuna,
that's the strange thing: I had enabled the logging in the backend of the template. But in the list only the manual exports are
listed (once a day). So I suspect that the cronjob calls joomla.php but with the wrong parameters so that CSVI is not called at all.
Our provider can only tell that the cronjob is running but not what it is actually doing...
Kind regards,
Petra
Hello Petra,
So I suspect that the cronjob calls joomla.php but with the wrong parameters so that CSVI is not called at all.
That is a good call because I think the same thing.
If you just call php joomla.php you get the output of available options. If you pass some invalid parameters you get some output as well telling you the parameters are wrong.
In a regular cron setup this output can be mailed to a given emailaddress. As I am completely lost on how your provider has set this up I would like to ask you if you can check with your provider what the output of the cronjob is. One more thing to check is that the cronjob does not end with this piece of code >/dev/null 2>&1 that means that all output is send into a black hole :D
In short, the cronjob must be outputting some info, where and what is that info?
Let me know how it goes.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Hi Roland,
thanks for your reply and suggestions. Unfortunately our provider is not very helpful with this.
He didn't provide any information on the cronjob except that it is running :(
Furthermore, as we don't have access to the shell we can hardly do any tests, where we would see some output.
I'll try to do some more (simpler) tests in order to see if I can get any Joomla cronjob to run. I'll let you know
the results, if any.
Kind regards,
Petra
Hello,
I just wanted to let you know, that I've found a workaround for the setup of the cronjob.
I'm calling the frontend URL of the export now as a cronjob and that works (export file is written).
It's probably not the best/intended solution, but maybe the only way for us as I have the impression
that with our provider "real" cronjobs (using the joomla cli with parameters) are simply not possible...
Best regards
Petra
Hello Petra,
The front-end export will work indeed as long as it does not become a really big export as you are limited to the 30 seconds of the server.
It is sad to hear there are apparently still hosters now supporting real cronjobs when they are an integral part of websites nowadays.
At least you have a workaround. :)
I will mark this topic as resolved and close it. If you have any further questions please create a new topic.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Log in to reply to this topic.