1. fatelettronica
  2. RO CSVI
  3. Tuesday, 26 July 2022
  4.  Subscribe via email
I have read the instructions for using the cron but I must say that the information contained is not sufficient to create a functioning cron system. I have also read some support articles.
Honestly, it is not well explained how to modify the cron.php file and therefore I will ask you some questions.
Which lines to modify (line number) content to modify and text to insert. I think everyone would be happy with it.
In the meantime, let's start with this.
Then the "mio.csv" file must be uploaded to the server, right, or do I have to upload it through the "Mio" template set as cron?
Ok I have to be accompanied step by step, I have never done this.
Thank you

Lorenzo
Accepted Answer Pending Moderation
Tharuna

It may not be possible for a server to trigger a command that is executable by browers. I am attaching screenshots
Where did you see the duplicate domain?
I checked and it is unique.

Thank you

Lorenzo
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hello Lorenzo,
It may not be possible for a server to trigger a command that is executable by browers.

The frontend import is for the servers which do not support real cron command and can run cron job using a URL. How does your server support cron jobs? Can you post us an example?

Where did you see the duplicate domain?

Please see the attached screenshot. Check what is before index.php?option=com_csvi. You also have the domain name already selected in list box.
Attachments (1)
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. # 2
Accepted Answer Pending Moderation
I have read a few things on the net and created an account on webcron.org, can this help? I have done some tests and it does not go with the configurations I know.
I believe aruba does not support the cron.
I have read that other systems put the script in the CLI folder.
I transcribe webcron's responses to the test with the start of the command from fron-end. Attached is the screenshot.
I insert the download of the log. I see it doesn't work.
I am also attaching the example of webcron but I don't understand what I have to insert after cron.php
"http://www.example.com/administrator/components/com_csvi/helpers/cron.php?username=admin&passwd=admin&template_id=xx";
Thank you

Lorenzo
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hello Lorenzo,
From the screenshots I see that you are using a wrong cron URL. The 301 status code in the screenshots shows that the URL you are using now is redirected. You should be using https://www.fatcomp.it/it/cron.html as cron URL in your cron configuration. Fix this and see if the cron runs as expected.
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. # 4
Accepted Answer Pending Moderation
Dear Tharuna

I opened a tichket in Aruba to fix the cron problem on their servers.

They replied suggesting to insert a script and run it from the sheduled task.
I'll copy their answer to you.
"Dear customer
in order to use the scheduled task included in the admin panel, you need to create a custom php script like the following as an example:

schedule.php

/ bin / php /web/htdocs/http://www.fatcomp.it/home/administrator/components/com_csvi/helper/cron.php username = "XXX" passwd = "YYY" template_name = "importAll" filename = "/ web / htdocs /http://www.fatcomp.it/home/media/import_all0.csv "> /web/htdocs/http://www.fatcomp.it/home/cronlog.log

check that it is running via the web and then schedule it via the panel.

I invite you to check and I remain at your disposal for further checks. "

I think you know better than me how to change it. I can only add username and password.

Do you think it will work?

Thank you

Lorenzo
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hello Lorenzo,
/ bin / php /web/htdocs/http://www.fatcomp.it/home/administrator/components/com_csvi/helper/cron.php username = "XXX" passwd = "YYY" template_name = "importAll" filename = "/ web / htdocs /http://www.fatcomp.it/home/media/import_all0.csv "> /web/htdocs/http://www.fatcomp.it/home/cronlog.log

The path of the cron file looks wrong /web/htdocs/http://www.fatcomp.it/home/administrator/components/com_csvi/helper/cron.php. This is a mix of relative and absolute URL. You cannot have domain name http://www.fatcomp.it in the path. You need to check the relative URL and use in the path.

They replied suggesting to insert a script and run it from the sheduled task.

I guess they are talking about bash script. Bash file is nothing but a text file with a collection of CLI commands. You can directly write the cron command in this bash script file and use it in cron task.
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. # 6
Accepted Answer Pending Moderation
Hello Lorenzo,

What Tharuna has told you is not completely correct because your code is malformed. Anything that is a link is prefixed with http:// on the forum. The advice given by Aruba is something we have given you as well I think. You should be able to use the URL https://www.fatcomp.it/it/cron.html because when I open that URL, your import starts.

If you use that URL either in Aruba hosting or some cron service, it should run as well. If not, Aruba has to tell you why it won't run. They are executing the URL different than a browser.

If you open that URL in your browser, the import starts right?
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. # 7
Accepted Answer Pending Moderation
Hello
So. Starting cron from backend does not work. It works only from the browser and you have to wait for the end before closing the browser.
Aruba does not provide the cron service but has these scheduled tasks that start an application.
As I wrote before, Aruba suggests creating a PHP file (application), named sckedule.php to start with scheduled tasks and the file must contain the lines described. They are suggested but need to be changed.
Honestly my php programming skills are amateurish and I am not able to create a php file. I just make a few changes.

Thank you
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hello Lorenzo,
So. Starting cron from backend does not work. It works only from the browser and you have to wait for the end before closing the browser.

That is correct. If you are running Frontend import then you need to wait for import to finish to close the browser.

Aruba does not provide the cron service but has these scheduled tasks that start an application.
As I wrote before, Aruba suggests creating a PHP file (application), named sckedule.php to start with scheduled tasks and the file must contain the lines described. They are suggested but need to be changed.

We cannot write cron commands in PHP file or we know how to do it. All we know is to write bash script to run cron command. Check if Aruba supports bash scripts.

The below instructions are for creating a bash script file


#!/usr/bin/env bash
php .....


1. In the above code update the php line with cron command
2. Save the above code as cron.sh and run it.
3. You can run the bash script as sh cron.sh or bash cron.sh

Honestly my php programming skills are amateurish and I am not able to create a php file. I just make a few changes.

If PHP file as Aruba suggested does not work or if it does not support bash scripts then the other option I see here is to hack the cron.php file. Make changes as per your import and run it directly. The problem here is that you can run only one import as the hacked code is specific for one template.
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. # 9
Accepted Answer Pending Moderation
Dear Tharuna

I believe the simplest solution is to hack the cron file.
If you write me which lines are to be changed I will try it immediately.
I save a copy and redo the changes with each update of ro csvi.
For now, I only need cron on one model.
Thank you
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Hello Lorenzo,
You need to replace the code which are sent as argument in cron command in cron file. Two things which needs to be hardcoded in cron file are key and template_id.

1. For key look for code


// Check if the secret key matches
$key = $this->input->get('key', '', 'raw');


and replace it


$key = "xxxxx";


Where xxxxx is the secret key you set in the template.

2. For template_id look for method loadTemplateId and replace the code


$template_id = $this->input->get('template_id', false, 'int');


to


$template_id = X


Where X is your template ID. You can also replace template name and template alias in below code.


$template_name = $this->input->get('template_name', false, 'string');
$templateAlias = $this->input->get('template_alias', false, 'string');


Let me know if that helps to run the cron.
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. # 11
Accepted Answer Pending Moderation
Dear Tharuna


$template_id = X

Sorry I need to know if x must be between "" and ends with; . It seems obvious but I believe I have doubts.
Thank you
  1. more than a month ago
  2. RO CSVI
  3. # 12
Accepted Answer Pending Moderation
Hello Lorenzo,
$template_id = X

Sorry I need to know if x must be between "" and ends with; . It seems obvious but I believe I have doubts.

You don't need to put X inside "" as it is an integer. Yes it should end with ; and I missed to put it in the code.


$template_id = X;
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. # 13
Accepted Answer Pending Moderation
Tharuna I did some tests and the hack doesn't work.

Let's try the bash.

This is the provider's response to my request to implement the bash script and other clarifications.

"Dear customer

in order to use the scheduled task included in the admin panel, you need to create a custom php script like the following as an example:

schedule.php

inside which it will insert the bash script as in the example to be executed through the exec () function

/ bin / php /web/htdocs/http://www.fatcomp.it/home/administrator/components/com_csvi/helper/cron.php username = "XXX" passwd = "YYY" template_name = "importAll" filename = "/ web / htdocs /http://www.fatcomp.it/home/media/import_all0.csv "> /web/htdocs/http://www.fatcomp.it/home/cronlog.log

check that it is running via the web (for example https://www.fatcomp.it/cartella/schedule.php) and then schedule it via the panel (dedicated guide: https://guide.hosting.aruba.it/hosting/servizi -including-website-creation / scheduled-tasks-manager-creation-new-task.aspx).
I invite you to check and I remain at your disposal for further checks. "
Ulteriori informazioni su questo testo di originePer avere ulteriori informazioni sulla traduzione è necessario il testo di origine
Invia commenti
Riquadri laterali
  1. more than a month ago
  2. RO CSVI
  3. # 14
Accepted Answer Pending Moderation
Hello Lorenzo,
Before looking into the bash script, send us the edited cron.php file. We can check if the edited file is correct and see a reason why it did not work for you.
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. # 15
Accepted Answer Pending Moderation
Tharuna
Here is the edited cron file.

Greetings
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 16
Accepted Answer Pending Moderation
Hello Lorenzo,
The edited cron file looks good. What is not working for you with the edited file? You see any error?

schedule.php

inside which it will insert the bash script as in the example to be executed through the exec () function

/ bin / php /web/htdocs/http://www.fatcomp.it/home/administrator/components/com_csvi/helper/cron.php username = "XXX" passwd = "YYY" template_name = "importAll" filename = "/ web / htdocs /http://www.fatcomp.it/home/media/import_all0.csv "> /web/htdocs/http://www.fatcomp.it/home/cronlog.log

Did you create the schedule.php file as explained? Did you try to run it from browser?

(dedicated guide: https://guide.hosting.aruba.it/hosting/servizi -including-website-creation / scheduled-tasks-manager-creation-new-task.aspx).

Link to their guide does not work and shows page not found error.
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. # 17
  • Page :
  • 1
  • 2


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