Environment
Description
I'm trying to run a command every 1 minute using Laravel Task Scheduling.
Attempt
I've added this line to my cron tab file
* * * * * php artisan schedule:run >> /dev/null 2>&1
Here is my /app/Console/Kernel.php
<?php
namespace AppConsole;
use IlluminateConsoleSchedulingSchedule;
use IlluminateFoundationConsoleKernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
AppConsoleCommandsInspire::class,
];
/**
* Define the application's command schedule.
*
* @param IlluminateConsoleSchedulingSchedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('inspire')->hourly();
$schedule->command('echo "Happy New Year!" ')->everyMinute(); //<---- ADD HERE }
}
I've added this line $schedule->command('echo "Happy New Year!" ')->everyMinute();
Question
How do I test this ?
How do I trigger my echo to display ?
How do I know if what I did is not wrong ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…