Backup still running although it has been set the schedule on specific time #1230
-
Hi everyone, I wonder why the backup still running although it has been set the schedule on specific time. I run backup database with cron has been set in my server. Here are the code snippet. app/Console/Kernel.php <?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
// 'App\Console\Commands\BackupDatabase'
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('backup:clean')->dailyAt('01:30');
$schedule->command('backup:run --only-db')->dailyAt('01:35');
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
} My cron config with run command
I was thinking like this:
That was I expect. But, the reality is still run every minute and backup every minute although I have been set method Is there I'm missing something? Could you please guide what should I do? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi anyone, I think I figure out the problem. Actually I should set the command |
Beta Was this translation helpful? Give feedback.
Hi anyone, I think I figure out the problem. Actually I should set the command
php artisan schedule:run
instead ofphp artisan backup:run
.