1. Picannick
  2. RO CSVI
  3. Tuesday, 21 January 2025
  4.  Subscribe via email
Hi there,

we are using a cron job to export a XML for Google Merchant once a day.
Until now (used with Joomla 3) we created a cron job (CLI) on our server with the following parameters.

/htdocs/administrator/components/com_csvi/helper/cron.php -- --key="mysecretkey" --template_id="1"

Now we migrated the site to Joomla 5 and I want to use sheduled task so that I only need one cron job on the server which triggers all sheduled tasks.
But I am a little helpless on how to set up the task.

I wanted to use the GET request. I have read that the cron job now works a little different.
Can I just put the following command into the URL field of the GET task?

https://www.domain.de/cli/joomla.php rocsvi:export --template_id=1 --key=mysecretkey

Or do I need to use something else?

Kind regards,
Tanja
Accepted Answer Pending Moderation
Hi Tanja,

I have read that the cron job now works a little different.
In Joomla 5 we have proper cron jobs that run via the Command Line Interface, hence the name of the folder in joomla is cli. So all cronjobs can be triggered via the Joomla CLI instead of every extension having their own way of doing things, there is now a uniform way of triggering cronjobs.

The new cron command does not work via the URL, the Joomla cron only runs via CLI just like the old cron does not work via the web browser. The only way I can think of is that you create a menu item for the template you want to run and point your scheduled task to the URL of the menu item. That at least works for me. Be aware, anything that runs longer than 30 seconds is most likely going to be terminated by the server. As this is not a real cron and therefore called the Poor Mans Cron :D

RO CSVI has not been tested with the Scheduled Tasks in Joomla as most users schedule cronjobs via the control panel of their hosting provider or directly in the crontab of the server.

Let me know if that helps.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi Roland,

thank you for your answer.
Just confirming that I understood it right:

So in the template I need to activate frontendcron? And then I create a menu item for the template, enter the secret key and trigger the URL via sheduled task?
As the secret key and the template ID is already set in the menu item, I do not need to add any URL parameter, do I?

And because of the timeout problem I have to test if the XML creation works properly?

Kind regards,
Tanja
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello Tanja,
So in the template I need to activate frontendcron? And then I create a menu item for the template, enter the secret key and trigger the URL via sheduled task?

Yes that is correct.

As the secret key and the template ID is already set in the menu item, I do not need to add any URL parameter, do I?

You don't need to add them to URL. When you create a menu item with secret key and template ID, link will be generated with these details. You can just copy the URL and use it for cron.

And because of the timeout problem I have to test if the XML creation works properly?

If export takes longer and hits server limits then there is a possibility to get timeout problem. It is good to check if export finishes without any issue.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Thank you Tharuna,

I will try it then this way.

Kind regards,
Tanja
  1. more than a month ago
  2. RO CSVI
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!