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