source: config/backup.php@ c5e383e

Last change on this file since c5e383e was c5e383e, checked in by beratkjufliju <kufliju@…>, 3 years ago

added db and storage backup

  • Property mode set to 100644
File size: 8.7 KB
RevLine 
[c5e383e]1<?php
2
3return [
4
5 'backup' => [
6
7 /*
8 * The name of this application. You can use this name to monitor
9 * the backups.
10 */
11 'name' => env('APP_NAME', 'laravel-backup'),
12
13 'source' => [
14
15 'files' => [
16
17 /*
18 * The list of directories and files that will be included in the backup.
19 */
20 'include' => [
21 base_path(),
22 ],
23
24 /*
25 * These directories and files will be excluded from the backup.
26 *
27 * Directories used by the backup process will automatically be excluded.
28 */
29 'exclude' => [
30 base_path('vendor'),
31 base_path('node_modules'),
32 ],
33
34 /*
35 * Determines if symlinks should be followed.
36 */
37 'follow_links' => false,
38
39 /*
40 * Determines if it should avoid unreadable folders.
41 */
42 'ignore_unreadable_directories' => false,
43
44 /*
45 * This path is used to make directories in resulting zip-file relative
46 * Set to `null` to include complete absolute path
47 * Example: base_path()
48 */
49 'relative_path' => null,
50 ],
51
52 /*
53 * The names of the connections to the databases that should be backed up
54 * MySQL, PostgreSQL, SQLite and Mongo databases are supported.
55 *
56 * The content of the database dump may be customized for each connection
57 * by adding a 'dump' key to the connection settings in config/database.php.
58 * E.g.
59 * 'mysql' => [
60 * ...
61 * 'dump' => [
62 * 'excludeTables' => [
63 * 'table_to_exclude_from_backup',
64 * 'another_table_to_exclude'
65 * ]
66 * ],
67 * ],
68 *
69 * If you are using only InnoDB tables on a MySQL server, you can
70 * also supply the useSingleTransaction option to avoid table locking.
71 *
72 * E.g.
73 * 'mysql' => [
74 * ...
75 * 'dump' => [
76 * 'useSingleTransaction' => true,
77 * ],
78 * ],
79 *
80 * For a complete list of available customization options, see https://github.com/spatie/db-dumper
81 */
82 'databases' => [
83 'mysql',
84 ],
85 ],
86
87 /*
88 * The database dump can be compressed to decrease diskspace usage.
89 *
90 * Out of the box Laravel-backup supplies
91 * Spatie\DbDumper\Compressors\GzipCompressor::class.
92 *
93 * You can also create custom compressor. More info on that here:
94 * https://github.com/spatie/db-dumper#using-compression
95 *
96 * If you do not want any compressor at all, set it to null.
97 */
98 'database_dump_compressor' => null,
99
100 /*
101 * The file extension used for the database dump files.
102 *
103 * If not specified, the file extension will be .archive for MongoDB and .sql for all other databases
104 * The file extension should be specified without a leading .
105 */
106 'database_dump_file_extension' => '',
107
108 'destination' => [
109
110 /*
111 * The filename prefix used for the backup zip file.
112 */
113 'filename_prefix' => '',
114
115 /*
116 * The disk names on which the backups will be stored.
117 */
118 'disks' => [
119 'local',
120 ],
121 ],
122
123 /*
124 * The directory where the temporary files will be stored.
125 */
126 'temporary_directory' => storage_path('app/backup-temp'),
127
128 /*
129 * The password to be used for archive encryption.
130 * Set to `null` to disable encryption.
131 */
132 'password' => env('BACKUP_ARCHIVE_PASSWORD'),
133
134 /*
135 * The encryption algorithm to be used for archive encryption.
136 * You can set it to `null` or `false` to disable encryption.
137 *
138 * When set to 'default', we'll use ZipArchive::EM_AES_256 if it is
139 * available on your system.
140 */
141 'encryption' => 'default',
142 ],
143
144 /*
145 * You can get notified when specific events occur. Out of the box you can use 'mail' and 'slack'.
146 * For Slack you need to install laravel/slack-notification-channel.
147 *
148 * You can also use your own notification classes, just make sure the class is named after one of
149 * the `Spatie\Backup\Events` classes.
150 */
151 'notifications' => [
152
153 'notifications' => [
154 \Spatie\Backup\Notifications\Notifications\BackupHasFailed::class => ['mail'],
155 \Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFound::class => ['mail'],
156 \Spatie\Backup\Notifications\Notifications\CleanupHasFailed::class => ['mail'],
157 \Spatie\Backup\Notifications\Notifications\BackupWasSuccessful::class => ['mail'],
158 \Spatie\Backup\Notifications\Notifications\HealthyBackupWasFound::class => ['mail'],
159 \Spatie\Backup\Notifications\Notifications\CleanupWasSuccessful::class => ['mail'],
160 ],
161
162 /*
163 * Here you can specify the notifiable to which the notifications should be sent. The default
164 * notifiable will use the variables specified in this config file.
165 */
166 'notifiable' => \Spatie\Backup\Notifications\Notifiable::class,
167
168 'mail' => [
169 'to' => 'your@example.com',
170
171 'from' => [
172 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
173 'name' => env('MAIL_FROM_NAME', 'Example'),
174 ],
175 ],
176
177 'slack' => [
178 'webhook_url' => '',
179
180 /*
181 * If this is set to null the default channel of the webhook will be used.
182 */
183 'channel' => null,
184
185 'username' => null,
186
187 'icon' => null,
188
189 ],
190 ],
191
192 /*
193 * Here you can specify which backups should be monitored.
194 * If a backup does not meet the specified requirements the
195 * UnHealthyBackupWasFound event will be fired.
196 */
197 'monitor_backups' => [
198 [
199 'name' => env('APP_NAME', 'laravel-backup'),
200 'disks' => ['local'],
201 'health_checks' => [
202 \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumAgeInDays::class => 1,
203 \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumStorageInMegabytes::class => 5000,
204 ],
205 ],
206
207 /*
208 [
209 'name' => 'name of the second app',
210 'disks' => ['local', 's3'],
211 'health_checks' => [
212 \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumAgeInDays::class => 1,
213 \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumStorageInMegabytes::class => 5000,
214 ],
215 ],
216 */
217 ],
218
219 'cleanup' => [
220 /*
221 * The strategy that will be used to cleanup old backups. The default strategy
222 * will keep all backups for a certain amount of days. After that period only
223 * a daily backup will be kept. After that period only weekly backups will
224 * be kept and so on.
225 *
226 * No matter how you configure it the default strategy will never
227 * delete the newest backup.
228 */
229 'strategy' => \Spatie\Backup\Tasks\Cleanup\Strategies\DefaultStrategy::class,
230
231 'default_strategy' => [
232
233 /*
234 * The number of days for which backups must be kept.
235 */
236 'keep_all_backups_for_days' => 7,
237
238 /*
239 * The number of days for which daily backups must be kept.
240 */
241 'keep_daily_backups_for_days' => 16,
242
243 /*
244 * The number of weeks for which one weekly backup must be kept.
245 */
246 'keep_weekly_backups_for_weeks' => 8,
247
248 /*
249 * The number of months for which one monthly backup must be kept.
250 */
251 'keep_monthly_backups_for_months' => 4,
252
253 /*
254 * The number of years for which one yearly backup must be kept.
255 */
256 'keep_yearly_backups_for_years' => 2,
257
258 /*
259 * After cleaning up the backups remove the oldest backup until
260 * this amount of megabytes has been reached.
261 */
262 'delete_oldest_backups_when_using_more_megabytes_than' => 5000,
263 ],
264 ],
265
266];
Note: See TracBrowser for help on using the repository browser.