Answer the question
In order to leave comments, you need to log in
How to run scheduled commands in laravel as root?
There is a project on laravel5, in it, according to the schedule, a command is launched in Kernel.php that writes a file to the storage folder:
$schedule->call(function()
{
\File::put(storage_path('test.txt'), 'tut text tut text tut text');
})->everyMinute();
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.the-website.cron</string>
<key>ProgramArguments</key>
<array>
<string>php</string>
<string>/Users/name/Desktop/project/artisan</string>
<string>schedule:run</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>60</integer>
</dict>
</plist>
chmod -R 777 storage
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