High level overview | laravel-backup | Spatie

 SPATIE

  Laravel Backup
=================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-backup](https://spatie.be/docs/laravel-backup/v8)  High level overview

 Version   v10   v9   v8   v7   v6   v5   v4   v3

 Other versions for crawler [v10](https://spatie.be/docs/laravel-backup/v10) [v9](https://spatie.be/docs/laravel-backup/v9) [v8](https://spatie.be/docs/laravel-backup/v8) [v7](https://spatie.be/docs/laravel-backup/v7) [v6](https://spatie.be/docs/laravel-backup/v6) [v5](https://spatie.be/docs/laravel-backup/v5) [v4](https://spatie.be/docs/laravel-backup/v4) [v3](https://spatie.be/docs/laravel-backup/v3)

- [ Introduction ](https://spatie.be/docs/laravel-backup/v8/introduction)
- [ Support us ](https://spatie.be/docs/laravel-backup/v8/support-us)
- [ Requirements ](https://spatie.be/docs/laravel-backup/v8/requirements)
- [ High level overview ](https://spatie.be/docs/laravel-backup/v8/high-level-overview)
- [ Installation and setup ](https://spatie.be/docs/laravel-backup/v8/installation-and-setup)
- [ Questions &amp; issues ](https://spatie.be/docs/laravel-backup/v8/questions-and-issues)
- [ Changelog ](https://spatie.be/docs/laravel-backup/v8/changelog)
- [ About us ](https://spatie.be/docs/laravel-backup/v8/about-us)

Taking Backups
--------------

- [ Taking backups ](https://spatie.be/docs/laravel-backup/v8/taking-backups/overview)
- [ Events ](https://spatie.be/docs/laravel-backup/v8/taking-backups/events)

Cleaning up old backups
-----------------------

- [ Cleaning up old backups ](https://spatie.be/docs/laravel-backup/v8/cleaning-up-old-backups/overview)
- [ Events ](https://spatie.be/docs/laravel-backup/v8/cleaning-up-old-backups/events)

Monitoring the health of all backups
------------------------------------

- [ Monitoring the health of all backups ](https://spatie.be/docs/laravel-backup/v8/monitoring-the-health-of-all-backups/overview)
- [ Creating your custom health check ](https://spatie.be/docs/laravel-backup/v8/monitoring-the-health-of-all-backups/creating-your-custom-health-check)
- [ Events ](https://spatie.be/docs/laravel-backup/v8/monitoring-the-health-of-all-backups/events)

Sending notifications
---------------------

- [ Sending notifications ](https://spatie.be/docs/laravel-backup/v8/sending-notifications/overview)
- [ Adding extra notification channels ](https://spatie.be/docs/laravel-backup/v8/sending-notifications/adding-extra-notification-channels)
- [ Customizing the notifiable ](https://spatie.be/docs/laravel-backup/v8/sending-notifications/customizing-the-notifiable)

Advanced Usage
--------------

- [ Adding extra files to a backup ](https://spatie.be/docs/laravel-backup/v8/advanced-usage/adding-extra-files-to-a-backup)
- [ Backing up a non-laravel application ](https://spatie.be/docs/laravel-backup/v8/advanced-usage/backing-up-a-non-laravel-application)
- [ Binary database dumps with PostgreSQL ](https://spatie.be/docs/laravel-backup/v8/advanced-usage/binary-database-dumps-with-postgresql)
- [ Encrypt backup archives ](https://spatie.be/docs/laravel-backup/v8/advanced-usage/encrypt-backup-archives)
- [ Isolated mode ](https://spatie.be/docs/laravel-backup/v8/advanced-usage/isolated-mode)

      You are viewing the documentation for **an older version** of this package. You can check the version you are using with the following command:

 `                                    composer show spatie/laravel-backup                                                                                                                                                                                                                                    `

High level overview
===================

###  On this page

1. [ Taking backups ](#content-taking-backups)
2. [ Cleaning up old backups ](#content-cleaning-up-old-backups)
3. [ Monitoring the health of all backups ](#content-monitoring-the-health-of-all-backups)

Taking backups
--------------------------------------------------------------------------------------------------

A backup is a .zip file containing all files in the directories you specify and a dump of your database (MySQL and PostgreSQL are supported). The .zip file can automatically be copied over to [any of the filesystems](https://laravel.com/docs/9.x/filesystem) you have configured.

To perform a new backup you just have to run `php artisan backup:run`. In most cases you'll want to schedule this command.

Cleaning up old backups
-----------------------------------------------------------------------------------------------------------------------------

As you create more and more backups, you'll eventually run out of disk space (or you'll have to pay a very large bill for storage). To prevent this from happening the package can delete old backups.

Monitoring the health of all backups
--------------------------------------------------------------------------------------------------------------------------------------------------------------------

The package can also check the health of your application's backups. A backup is considered unhealthy if the date of the last backup is too far in the past for it to be useful or if the backup becomes too large. In addition to monitoring the health of the application's own backups, backups of other applications can be monitored as well.
