Answer the question
In order to leave comments, you need to log in
How to set user for cron?
Good day!
Run php script with cron. But the script needs to delete the file from the folder during execution. When you run the script manually - everything is ok. When launched by cron - does not delete (probably lacks rights). Is it possible to set on behalf of which user to run cron, if not, how to find out which user it is running under in order to configure access rights to the folder.
I run it like this:
* * * * * /usr/bin/php /usr/local/www/db_request/misc/test.php
if I change it to root, for example, it doesn't work.
* * * * * root /usr/local/www/db_request/misc/test.php
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question