1
0
mirror of https://github.com/Kovah/LinkAce.git synced 2025-04-21 07:22:20 +02:00

Add more configuration options for backups

This commit is contained in:
Kovah 2025-01-12 23:05:43 +01:00
parent 634fa86e83
commit 35a4a5253f
2 changed files with 18 additions and 10 deletions

View File

@ -2,14 +2,6 @@
namespace App\Console;
use App\Console\Commands\CheckLinksCommand;
use App\Console\Commands\CompleteSetupCommand;
use App\Console\Commands\ImportCommand;
use App\Console\Commands\ListUsersCommand;
use App\Console\Commands\RegisterUserCommand;
use App\Console\Commands\ResetPasswordCommand;
use App\Console\Commands\UpdateLinkThumbnails;
use App\Console\Commands\ViewRecoveryCodesCommand;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
@ -22,8 +14,15 @@ class Kernel extends ConsoleKernel
$schedule->command('links:check')->hourly();
if (config('backup.backup.enabled')) {
$schedule->command('backup:clean')->daily()->at('01:00');
$schedule->command('backup:run')->daily()->at('02:00');
$notificationsDisabled = config('backup.notifications.enabled') === false;
$schedule->command('backup:clean', ['--disable-notifications' => $notificationsDisabled])
->daily()
->at(config('backup.backup.clean_hour'));
$schedule->command('backup:run', ['--disable-notifications' => $notificationsDisabled])
->daily()
->at(config('backup.backup.backup_hour'));
}
}

View File

@ -6,6 +6,13 @@ return [
'enabled' => env('BACKUP_ENABLED', true),
/*
* Set the hour for cleaning old backups and creating a new one. Format must be in 24-hour time like
* '03:00' for 3 am or '14:00' for 2 pm.
*/
'clean_hour' => env('BACKUP_CLEAN_HOUR', '01:00'),
'backup_hour' => env('BACKUP_RUN_HOUR', '02:00'),
/*
* The name of this application. You can use this name to monitor
* the backups.
@ -153,6 +160,8 @@ return [
*/
'notifications' => [
'enabled' => env('BACKUP_NOTIFICATIONS_ENABLED', true),
'notifications' => [
\Spatie\Backup\Notifications\Notifications\BackupHasFailedNotification::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFoundNotification::class => ['mail'],