/
laravel-backup.php
156 lines (131 loc) · 4.35 KB
/
laravel-backup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php
return [
'backup' => [
/*
* The name of this application. You can use this name to monitor
* the backups.
*/
'name' => env('APP_URL'),
'source' => [
'files' => [
/*
* The list of directories that should be part of the backup. You can
* specify individual files as well.
*/
'include' => [
base_path(),
],
/*
* These directories will be excluded from the backup.
* You can specify individual files as well.
*/
'exclude' => [
base_path('vendor'),
storage_path(),
],
],
/*
* The names of the connections to the databases
* that should be part of the backup.
*/
'databases' => [
'mysql'
],
],
'destination' => [
/*
* The filesystems you on which the backups will be stored. Choose one or more
* of the filesystems you configured in app/config/filesystems.php
*/
'filesystems' => [
'local'
],
],
],
'cleanup' => [
/*
* The strategy that will be used to cleanup old backups.
* The youngest backup wil never be deleted.
*/
'strategy' => \Spatie\Backup\Tasks\Cleanup\Strategies\DefaultStrategy::class,
'defaultStrategy' => [
/*
* The amount of days that all daily backups must be kept.
*/
'keepDailyBackupsForDays' => 16,
/*
* The amount of weeks of which one weekly backup must be kept.
*/
'keepWeeklyBackupsForWeeks' => 8,
/*
* The amount of months of which one monthly backup must be kept.
*/
'keepMonthlyBackupsForMonths' => 4,
/*
* The amount of years of which one yearly backup must be kept
*/
'keepYearlyBackupsForYears' => 2,
/*
* After clean up the backups remove the oldest backup until
* this amount of megabytes is reached.
*/
'deleteOldestBackupsWhenUsingMoreMegabytesThan' => 5000
]
],
/*
* In this array you can specify which backups should be monitored.
* If a backup does not meet the specified requirements the
* UnHealthyBackupWasFound-event will be fired.
*/
'monitorBackups' => [
[
'name' => env('APP_URL'),
'filesystems' => ['local'],
'newestBackupsShouldNotBeOlderThanDays' => 1,
'storageUsedMayNotBeHigherThanMegabytes' => 5000,
],
/*
[
'name' => 'name of the second app',
'filesystems' => ['local'],
'newestBackupsShouldNotBeOlderThanDays' => 1,
'storageUsedMayNotBeHigherThanMegabytes' => 5000,
],
*/
],
'notifications' => [
/*
* This class will be used to send all notifications.
*/
'handler' => Spatie\Backup\Notifications\Notifier::class,
/*
* Here you can specify the ways you want to be notified when certain
* events take place. Possible values are "log", "mail" and "slack".
*
* Slack requires the installation of the maknz/slack package
*/
'events' => [
'whenBackupWasSuccessful' => ['log'],
'whenCleanupWasSuccessful' => ['log'],
'whenHealthyBackupWasFound' => ['log'],
'whenBackupHasFailed' => ['log', 'mail'],
'whenCleanupHasFailed' => ['log', 'mail'],
'whenUnHealthyBackupWasFound' => ['log', 'mail']
],
/*
* Here you can specify how mails should be sent.
*/
'mail' => [
'from' => 'your@email.com',
'to' => 'your@email.com',
],
/*
* Here you can how messages should be sent to Slack.
*/
'slack' => [
'channel' => '#backups',
'username' => 'Backup bot',
'icon' => ':robot:',
],
]
];