Interpret if link is being executed by browser or cronjob [closed]

0

I have a cronjob running but practically the link (code in PHP) is published because for the cronjob to work the authentication verification system is disabled. So I would like to know some way so that this link is not made public by the browser, and only cronjob makes it work without authentication.

    
asked by anonymous 24.12.2016 / 02:57

1 answer

2

Hello

Instead of using the page server engine, use the CLI mode of the interpreter. For example in php you can type in the command line "php-cli /hosts/domainexample.com/www/nomepage.php" and it will return the output in bash. Only use this line in cron. Search for CLI options such as verbosity and timeout to improve performance, and how to use returns. ;) PHP, Perl, Python - > All work on the command line.

Find out what you need: link

I hope I have helped.

Hugs!

    
24.12.2016 / 03:04