M
M
Mortech2020-10-27 13:37:33
PHP
Mortech, 2020-10-27 13:37:33

Executing php script with cron authentication?

There is a php script with the simplest authentication through .htaccess, which sends mail to a specific address. The script works (it is executed from the console), the url is also displayed. But how to set it in the crown so that when the script is executed, it makes an http request (this is how the task is set) and executes the script? In crontab -e tried to do in a similar way. And for some reason the value of MAILTO gets lost every time.

MAILTO="[email protected]"
*/3 * * * *  /usr/bin/curl -O temp.txt http://loungefirst.ml/smt.php
5 9,10 * * 1,3,5  /usr/bin/wget -O /dev/null 2>&1 -q http://loungefirst.ml/sendEmail.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FanatPHP, 2020-10-27
@Mortech

If the request is to the same host that the cron is running on, such a "task so set" is just stupid.
In general, it is a shame not to be able to use the Internet at this age .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question