国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

指定時(shí)間時(shí)Cron作業(yè)無法正常工作
P粉347804896
P粉347804896 2024-03-28 15:24:27
0
2
625

我有一個(gè) Laravel 項(xiàng)目 v8,并且我已經(jīng)創(chuàng)建了一個(gè)用于數(shù)據(jù)庫備份的 cron 作業(yè)

它每分鐘都在工作,但當(dāng)我指定每天的時(shí)間時(shí),它就不起作用。

項(xiàng)目時(shí)區(qū)是“亞洲/加爾各答”,我的 GoDaddy 共享服務(wù)器時(shí)區(qū)是 UTC。

內(nèi)核.php

<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        // $schedule->command('backup:clean')->everyMinute();
        $schedule->command('backup:run')->cron('51 3 * * *');
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}

我在 Cpanel 上的 cronjob。

P粉347804896
P粉347804896

全部回復(fù)(2)
P粉057869348

替換您的kernel.php

command('backup:clean')->everyMinute();
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}

在此之后,在 Cpanel 上設(shè)置 cronjob 以及您要執(zhí)行的時(shí)間

檢查 cpanel 中的給定時(shí)間,cron 一定會(huì)工作

P粉232793765

你可以像這樣運(yùn)行 cron:

protected function schedule(Schedule $schedule)
{
     $schedule->command('backup:run')->dailyAt('03:51');
}
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板