From f26f3f0919663c6c3e38bbde8435bb5840da51e9 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Wed, 13 May 2020 16:42:22 +0200 Subject: [PATCH] - add cron rejecting dataset - add cron job for deleting log file daily - change cron job for deleting expired cache files (without logging) --- app/Console/Commands/Log/ClearLogFile.php | 43 +++++++++++++++++++++++ app/Console/Kernel.php | 14 +++++--- 2 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 app/Console/Commands/Log/ClearLogFile.php diff --git a/app/Console/Commands/Log/ClearLogFile.php b/app/Console/Commands/Log/ClearLogFile.php new file mode 100644 index 0000000..2930888 --- /dev/null +++ b/app/Console/Commands/Log/ClearLogFile.php @@ -0,0 +1,43 @@ + ' . storage_path('logs/laravel.log')); + $this->info('Logs have been cleared'); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 7d3711a..bcdf533 100755 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -15,6 +15,7 @@ class Kernel extends ConsoleKernel 'App\Console\Commands\Inspire', 'App\Console\Commands\DatasetState', 'App\Console\Commands\SolrIndexBuilder', + 'App\Console\Commands\Log\ClearLogFile' ]; /** @@ -30,12 +31,17 @@ class Kernel extends ConsoleKernel // ->withoutOverlapping() // ->appendOutputTo(storage_path('logs/inspire.log')); - // $schedule->command('state:dataset'); - // // ->appendOutputTo(storage_path('logs/inspire.log')); + $schedule->command('log:clear') + ->daily() + ->withoutOverlapping(); + + $schedule->command('state:dataset') + ->daily() + ->withoutOverlapping(); $schedule->command('cache:clear-expired') - ->twiceDaily(1, 16) - ->appendOutputTo(storage_path('logs/cacheClear.log')); + ->twiceDaily(1, 16); + //->appendOutputTo(storage_path('logs/cacheClear.log')); } /**