当前位置:网站首页>Larave database backup scheduled task

Larave database backup scheduled task

2022-06-22 03:55:00 . Sea moon

Manual reference : Task scheduling | further |《Laravel 9 Chinese document 9.x》| Laravel China Community (learnku.com)

Reference blog  laravel 8 adopt Task scheduling Realization Database backup | Laravel China Community (learnku.com)

The scheduled tasks written in this blog are 2:00 Automatic backup For demonstration Sure

stay App\Console\Kernel Write code

protected function schedule(Schedule $schedule)
    {
        // $schedule->command('inspire')->hourly();

            // The backup command is executed every minute 
        $schedule->command('backup:run --disable-notifications')->everyMinute();
    }

This is a laravel Relevant frequency function provided

If the order is executed ,zip Empty folder    Use the command to view the local computer mysql Is the environment variable configured   mysqldump  

If not for , Configure this computer mysql, System variables  

Computer restart , Perform project work command  

原网站

版权声明
本文为[. Sea moon]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206220342071602.html