Answer the question
In order to leave comments, you need to log in
How to run a cron script correctly?
Hello everyone, on the nginx + php-fpm server, which run under the nginx user, there is a script that runs both by cron (once a day) and by an event on the site. The script logs some data, and a new log file is created every day. The problem is that if this file is created by cron, it is owned by root and nginx can no longer write to it.
How to run cron from under another user, or what is the right way to do it in this case?
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