Skip to content

Commit 0d64116

Browse files
Update backup configuration to disable retention periods and adjust cleanup thresholds
1 parent b59a206 commit 0d64116

File tree

3 files changed

+40
-15
lines changed

3 files changed

+40
-15
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace App\Console\Commands;
4+
5+
use Illuminate\Console\Command;
6+
7+
class SimpedeBackup extends Command
8+
{
9+
/**
10+
* The name and signature of the console command.
11+
*
12+
* @var string
13+
*/
14+
protected $signature = 'simpede:backup';
15+
16+
/**
17+
* The console command description.
18+
*
19+
* @var string
20+
*/
21+
protected $description = 'Backup Application';
22+
23+
/**
24+
* Execute the console command.
25+
*/
26+
public function handle()
27+
{
28+
$this->call('action-events:clear');
29+
$this->call('queue:clear');
30+
$this->call('backup:run');
31+
$this->call('backup:clean');
32+
}
33+
}

config/backup.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,40 +290,40 @@
290290
/*
291291
* The number of days for which backups must be kept.
292292
*/
293-
'keep_all_backups_for_days' => 7,
293+
'keep_all_backups_for_days' => 0,
294294

295295
/*
296296
* After the "keep_all_backups_for_days" period is over, the most recent backup
297297
* of that day will be kept. Older backups within the same day will be removed.
298298
* If you create backups only once a day, no backups will be removed yet.
299299
*/
300-
'keep_daily_backups_for_days' => 16,
300+
'keep_daily_backups_for_days' => 0,
301301

302302
/*
303303
* After the "keep_daily_backups_for_days" period is over, the most recent backup
304304
* of that week will be kept. Older backups within the same week will be removed.
305305
* If you create backups only once a week, no backups will be removed yet.
306306
*/
307-
'keep_weekly_backups_for_weeks' => 8,
307+
'keep_weekly_backups_for_weeks' => 0,
308308

309309
/*
310310
* After the "keep_weekly_backups_for_weeks" period is over, the most recent backup
311311
* of that month will be kept. Older backups within the same month will be removed.
312312
*/
313-
'keep_monthly_backups_for_months' => 4,
313+
'keep_monthly_backups_for_months' => 0,
314314

315315
/*
316316
* After the "keep_monthly_backups_for_months" period is over, the most recent backup
317317
* of that year will be kept. Older backups within the same year will be removed.
318318
*/
319-
'keep_yearly_backups_for_years' => 2,
319+
'keep_yearly_backups_for_years' => 0,
320320

321321
/*
322322
* After cleaning up the backups remove the oldest backup until
323323
* this amount of megabytes has been reached.
324324
* Set null for unlimited size.
325325
*/
326-
'delete_oldest_backups_when_using_more_megabytes_than' => 15000,
326+
'delete_oldest_backups_when_using_more_megabytes_than' => 1,
327327
],
328328

329329
/*

routes/console.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44

55
Schedule::command('reminder:send')->hourly()
66
->sentryMonitor();
7-
Schedule::command('action-events:clear')->daily()
8-
->sentryMonitor();
9-
Schedule::command('queue:clear')->daily()
10-
->sentryMonitor();
117
Schedule::command('holidays:sync')->daily()
128
->sentryMonitor();
139
if (config('app.auto_update')) {
@@ -20,11 +16,7 @@
2016
->withoutOverlapping()
2117
->timezone(config('app.schedule_timezone'))
2218
->sentryMonitor();
23-
Schedule::command('backup:clean')->dailyAt('16:30')
24-
->withoutOverlapping()
25-
->timezone(config('app.schedule_timezone'))
26-
->sentryMonitor();
27-
Schedule::command('backup:run')->dailyAt('17:00')
19+
Schedule::command('simpede:backup')->dailyAt('17:30')
2820
->withoutOverlapping()
2921
->timezone(config('app.schedule_timezone'))
3022
->sentryMonitor();

0 commit comments

Comments
 (0)