Benvenuto

Ciao AlexeyBaturin!

Benvenuta/o su Wikivoyage in lingua italiana! Stiamo realizzando un'attendibile guida turistica mondiale libera e aggiornabile. Aiutaci anche tu! Se hai appena conosciuto Wikivoyage e non sai come funziona e in che modo puoi aiutarci, poni le tue domande nella Lounge, il punto d'incontro dei wikiviaggiatori, oppure consulta le nostre pagine di aiuto.

Potrai trovare risposte ai tuoi dubbi anche nelle pagine delle domande frequenti e dei consigli per i nuovi arrivati.

Ricordati soprattutto che è vietato copiare testi protetti da copyright. Il nostro obiettivo non è proporre contenuti copiati da altri siti, ma scrivere una nuova guida turistica di nostro pugno.
 


--Andyrom75 (discussioni) 16:37, 24 giu 2020 (CEST)Rispondi

Wikivoyage tool on Toolforge

modifica

Hi Alexey, I've finally patched the first script inside that tool. Now I need to "play" with Linux crontab because I need to remove a useless task that create problems, and add another useful task to updated periodically an archive.

Since I'm not familiar with crontab, I've just renamed the called php file, with this "not-at-all elegant trick" I've reached my goal, but I need to remove the task for a clean solution.

The task I want to schedule, is to execute weekly a public php (https://wikivoyage.toolforge.org/w/artmap.php?lang=it).

Could you support? --Andyrom75 (discussioni) 01:04, 31 lug 2020 (CEST)Rispondi

Andyrom75, to add a task to crontab, run "become wikivoyage" then "crontab -e", that should open crontab editor. Here you should add something like:
* * * 1 * php /data/project/wikivoyage/public_html/w/artmap.php
Than will execute the script every Monday (the 4th position in crontab format). But you can't pass "lang=it" in that way to the script, you should modify the script to parse command-line parameters.
Alternatively if you want to execute the script in the same way as you run it from your browser - you could use curl:
* * * 1 * curl https://wikivoyage.toolforge.org/w/artmap.php?lang=it
That's a bit less reliable than just running CLI command, but I think should work well in your situation.
--AlexeyBaturin (discussioni) 08:46, 2 ago 2020 (CEST)Rispondi
I need your support to understand what's happened...
I've inserted your suggested alternative with curl (because of the parameters) and it worked untile 30-August.
Since yesterday the script hasn't run I've opened again the crontab and I've found the following instruction in place of the one inserted by me:
What does it means and who changed it? --Andyrom75 (discussioni) 23:37, 8 set 2020 (CEST)Rispondi
Andyrom75, unfortunately I have no idea. Probably we should ask everyone who has access to the project - you could check list of maintainers at https://toolsadmin.wikimedia.org/. I found the following instruction https://wikitech.wikimedia.org/wiki/Help:Toolforge/Grid#Submitting_simple_one-off_jobs_using_%27jsub%27 but I have no idea why it was necessary to use that jsub tool. --AlexeyBaturin (discussioni) 16:23, 9 set 2020 (CEST)Rispondi
I've tried to modify it in
Let's see if with a less ambiguous name like cron-24 and without the parameter -once, it will restart again from tomorrow. --Andyrom75 (discussioni) 16:42, 9 set 2020 (CEST)Rispondi
Nothing happened. I've noticed that every time I exit from "crontab -e" saving a job that is not managed from jsub, it shows the following message:
NOTE: some crontab entries have been modified to grid submissions.
You may want to examine the result with 'crontab -e'.
So most likely there's a listener that force that change, but the result is that the script is not launched, or at least it doesn't work. Any suggestion on what to do? --Andyrom75 (discussioni) 09:03, 11 set 2020 (CEST)Rispondi
Trying to understand what's happening, I've changed teh frequency from "* * * 4 *" to "00 21 * * *".
Now, everyday I receive an email with this subject:
Cron <tools.wikivoyage@tools-sgecron-01> /usr/bin/jsub -N itvoy-artmap curl https://wikivoyage.toolforge.org/w/artmap.php?lang=it
and this content:
Your job 22xxxxx ("itvoy-artmap") has been submitted
But unfortunately nothing happens... do you think that "jsub" prevent curl from running? Any B plan? --Andyrom75 (discussioni) 12:40, 13 set 2020 (CEST)Rispondi
Andyrom75, I've slightly modified the existing job (now it looks like "0 21 * * * jsub -N itvoy-geodata -once curl https://wikivoyage.toolforge.org/w/geodata.php?group=it") and made it to be executed every minute - and instantly got result. You could check output at /data/project/wikivoyage/itvoy-geodata.out. Not sure what was wrong, but it actually worked. There seems to be no problems with curl. Let's wait and check if it runs every day 21:00. --AlexeyBaturin (discussioni) 18:57, 14 set 2020 (CEST)Rispondi