backup.php 7.6 KB

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