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 is functional. So let's go!
Yes, the script is FUNCTIONAL . But there's a small question [zinha].
When you call curl
with parameter -s
, it does not generate output.
When you call curl
with parameter -o
, it stores the output in such a file.
So, to fix your script (in spite of being functional), just call curl
with parameter -s
and request path:
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 the shell server. So it would be more appropriate to call your script directly with PHP . It would be enough to know the PHP path on the server, which would end up being the one who will install your cronjob . Usually stays in /usr/local/bin/php
. Hence his 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 stated. Usually stays in /var/www/html
.
If your cronjob objective is to run this PHP script every day at 0:00 AM (midnight) , it will work fine.