Probar si un cron es ejecutado solo por el servidor [duplicado]
Frecuentes
Visto 89 veces
0
Posible duplicado:
En php, ¿cómo detectar la ejecución es desde el modo CLI o mediante el navegador?
How to test if a cron is executed only by the server
Muchas Gracias
1 Respuestas
1
Cron will never put anything on the display unless you use something like 'wall' in your cron script.
Are you redirecting your output to a log file or anything?
What you can do is to add a line at the bottom of the script you are executing in the cron; that does something like:
date +"%D %r `echo Cron completed`" >> /tmp/cron_job.log
Entonces podrías comprobar
cat /tmp/cron_job.log
and it would tell you when it finished.
Respondido 24 ago 12, 03:08
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas php cron or haz tu propia pregunta.
As opposed to being executed by what else? - Michael Berkowski
by accessing the file with the url : www.example.com/crons.php - user1475195
Is cron supposed to execute it directly from the shell, or by requesting it via http, like via
wget
? - Michael Berkowskii set up the cron with crontab -e, but the file can be accessed via the website - user1475195
Why not set up that (presumably private) script on a different virtual host that's not listening on any external interface? - Greg Hewgill