mailwolt/routes/console.php

35 lines
1.3 KiB
PHP

<?php
use App\Jobs\RunHealthChecks;
use App\Models\BackupPolicy;
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schedule;
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
Schedule::job(RunHealthChecks::class)->everyMinute()->withoutOverlapping();
Schedule::command('spamav:collect')->everyFiveMinutes()->withoutOverlapping();
//Schedule::command('mailwolt:check-updates')->dailyAt('04:10');
Schedule::command('mailwolt:check-updates')->everytwoMinutes();
Schedule::command('rbl:probe')->weeklyOn(0, '3:30')->withoutOverlapping();
Schedule::command('mail:update-stats')->everyFiveMinutes()->withoutOverlapping();
Schedule::command('health:probe-disk', ['target' => '/', '--ttl' => 900])->everyTenMinutes();
Schedule::command('health:collect')->everyTenSeconds();
// Backup-Policies dynamisch einplanen
try {
BackupPolicy::where('enabled', true)->each(function (BackupPolicy $policy) {
Schedule::command("backup:scheduled {$policy->id}")
->cron($policy->schedule_cron)
->withoutOverlapping()
->runInBackground();
});
} catch (\Throwable) {
// DB noch nicht verfügbar (z.B. während Migration)
}