CRONTAB Run for a certain time

Asked

Viewed 132 times

1

Hello I’m having trouble running php’s Document root directly on crontab

current rule working correctly

23 23 * * * Sleep 33 && wget -t 1 -T 1800 http://www.dominio.com.br/script.php

Explanations 23:23 //perform every day at eleven twenty-three Sleep 33 //wait 33 seconds of 23 minutes to start wget //calls url -t 1 //run only once -T 1800 //run for 1800 seconds, otherwise kill the process

i would like to change the call run directly from php ex:

23 23 * * * Sleep 33 && php -f /document_root/script.php

//The above example works! //would you like to know what -f is? //I tried to add -t 1 in the following ways below, but none worked

23 23 * * * Sleep 33 && php -f -t 1 /document_root/script.php //not works 23 * * * Sleep 33 && php -t 1 /document_root/script.php //does not work 23 23 * * * Sleep 33 && php -t 1 -f /document_root/script.php //not working 23 23 * * * Sleep 33 && php -f /document_root/script.php -t 1 //does not work 23 23 * * * Sleep 33 && -t 1 php -f /document_root/script.php //does not work

Has anyone been through this? Thank you Marco

  • The PHP command has no control of timeout; you will need to control this directly in the code.

  • In my example above, the cron itself has this in the wget call, but I don’t know how to use it in the php call in cron, not in the php script of the execution

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.