Tâches automatiques (cron) - Tache cron pour ical
... / Tache cron pour ical
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

Tache cron pour ical

Von
FredericC28
Erstellungsdatum 2018-08-11 18:32:13 (edited on 2024-09-04 10:48:06) in Tâches automatiques (cron)

Bonjour,
J'ai besoin de creer un srcipt php avec la commande wget http://-----------------.com/?sh_ical=sync_all
pour éxecuter une tache CRON avec l'interface, je n'ai aucune idée de ce qu'il faut mettre exactement, quelqu'un peu m'aider svp ?? merci beaucoup


9 Antworten ( Latest reply on 2018-08-15 12:27:46 Von
FredericC28
)


je n'ai aucune idée de ce qu'il faut mettre exactement


par exemple dans la doc ? http://lmgtfy.com/?q=cron+chez+OVH

j'avais déja regardé..., mais je parlais du script php a inserer dans le fichier cron.php
du genre wget .....
merci


wget


Il y a un exemple avec 'curl' dans un des résultats.

Bonjour,
J'ai créé un script qui fonctionne mais qui laisse apparaitre quelques erreurs(pathconf: Value too large for defined data type), le problème c'est que je n'arrive pas à les corriger :(
Merci

voici le script :



exec("wget --http-user=[user] --http-password=[pass] http://****************.com/?sh_ical=sync_all");

?>

Et le log :


[2018-08-15 12:39:01] ## OVH ## START - 2018-08-15 12:39:01.744022 executing: /usr/local/php7.2/bin/php /********/******/./www/cron.php
**[2018-08-15 12:39:01] pathconf: Value too large for defined data type**
**[2018-08-15 12:39:01] pathconf: Value too large for defined data type**
[2018-08-15 12:39:01] --2018-08-15 10:39:01-- http://************.com/?sh_ical=sync_all
[2018-08-15 12:39:01] Resolving **********.com (************.com)... 87.98.154.146
[2018-08-15 12:39:01] Connecting to ************.com (************.com)|87.98.154.146|:80... connected.
[2018-08-15 12:39:01] HTTP request sent, awaiting response... 200 OK
[2018-08-15 12:39:01] Length: unspecified [text/html]
[2018-08-15 12:39:01] Saving to: ‘index.html?sh_ical=sync_all.87’
[2018-08-15 12:39:01]
[2018-08-15 12:39:01] 0K 4.45M=0s
[2018-08-15 12:39:01]
[2018-08-15 12:39:01] 2018-08-15 10:41:08 (4.45 MB/s) - ‘index.html?sh_ical=sync_all.87’ saved [58]
[2018-08-15 12:39:01]
[2018-08-15 12:39:01]
[2018-08-15 12:39:01] ## OVH ## END - 2018-08-15 10:41:08.622673 exitcode: 0

Bonjour,

pourquoi faire un wget quand un simple curl suffit ?

Car je suppose que le cron à juste besoin d’appeler la page (curl) et non de la télécharger (wget).

Cordialement, janus57

Ah d'accord ! il faut juste que je change wget par curl dans la fonction ?

Ah d'accord ! il faut juste que je change wget par curl dans la fonction ?
suis un peu débutant ....

curl comme wget sortent en standard dans STDOUT, donc ne téléchargent pas (si la page n'en provoque pas)

si gênant, rediriger STDOUT: `wget -O /dev/null` ou `cur -o /dev/null` mais tu devrais moins en voir dans les logs

si tu essayes curl, la syntaxe des options peut changer.

> HTTP request sent, awaiting response... 200 OK

tout semble marcher

> pathconf: Value too large for defined data type

pas certain que tu sois la cause de ce message, mais si ça marche...

merci beaucoup