Reputation: 473
I have setted a cron using schedule funcion in kernel.php
file of laravel. It is calling a method which is writing logs.
My problem is log file is created with root user. Can I set the permissions of the file or execute that cron with a certain user?
Upvotes: 0
Views: 1126
Reputation: 178
You can change the file permission with the user you want with this command:
cd path-to-log-folder && chown your-user:your-group file-name
Otherwise, you can set the cronjob run by a specific user with this command:
crontab -u your-user -e
and change the ownership of your log file with the same user (I prefer this way).
Upvotes: 1