The title of the question does not suggest the same as the content of the question.
In my interpretation you need to "test" your script to see if it’s functional. So let’s go!
Yes, the script is FUNCTIONAL. But there’s one small question[little].
When you call the curl
parameter -s
, it does not generate output.
When you call the curl
parameter -o
, it stores the output in such file.
So to fix your script (despite being functional), just call the curl
with the parameter -s
and the path of requisition:
curl -s http://site.com.br/disparar-cobranca/index.php
Another thing: If you’re requesting this from a company, it obviously has access to shell server. Then, it would be more appropriate to call your script straight with the PHP. Just knowing the way PHP on the server, which would eventually be on account of who will install your cronjob. Usually stays in /usr/local/bin/php
. Hence its cronjob would look like this:
0 0 * * * /usr/local/bin/php /caminho/do/site/no/servidor/index.php
PS: /caminho/do/site/no/servidor/index.php
should be changed according to the path of your site, as already made explicit. Usually it is in /var/www/html
.
If the purpose of your cronjob is to rotate this php script every day at midnight (midnight), will work right.
Hello @Lipespry. Perfect. Thank you very much for the clarifications.
– user24136