Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.www.php > #21515

Re: redirect tramite cron su file php remoto

From Alessandro Pellizzari <shuriken@amiran.it>
Newsgroups it.comp.www.php
Subject Re: redirect tramite cron su file php remoto
Date 2017-03-21 11:09 +0000
Message-ID <ejcfv7F2qg7U1@mid.individual.net> (permalink)
References <oaqkr9$1f5k$1@gioia.aioe.org>

Show all headers | View raw


On 21/03/17 07:30, NoS wrote:

> - se però, imposto un CRON, sul server BBB, il cui compito è eseguire
> http://BBB.com/lanciascript.php, l'operazione di CRON viene eseguita ma
> la chiamata/redirect non va a buon fine ed il log del CRON mi
> restituisce un errore 302.

302 non e` un errore. E` una richiesta di redirect al browser.

Sul browser ti funziona perche` e` il browser stesso a fare la seconda 
richiesta in automatico.

Su cron no, perche` chiami lo script da CLI e la CLI non ha idea di cosa 
sia un redirect. Dovresti gestirlo a mano.

Su BBB non ti serve uno script PHP.
Puoi usare wget o curl per richiamare direttamente lo script su AAA:

wget http://aaa.com/script.php

Cerca sul manuale di wget e curl come gestire l'output. Di default wget 
salva su disco, ma puoi redirigerlo a stdout in modo che cron te lo 
mandi via email, o scartarlo, se non ti interessa.

Bye.

Back to it.comp.www.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

redirect tramite cron su file php remoto NoS <NoS@nospam.no> - 2017-03-21 08:30 +0100
  Re: redirect tramite cron su file php remoto Alessandro Pellizzari <shuriken@amiran.it> - 2017-03-21 11:09 +0000
    Re: redirect tramite cron su file php remoto NoS <NoS@nospam.no> - 2017-03-21 12:10 +0100

csiph-web