The backup process | laravel-backup-server | Spatie

   [Docs](https://spatie.be/docs)  [Laravel-backup-server](https://spatie.be/docs/laravel-backup-server/v3)  Taking-backups  The backup process

 Version   v4   v3   v2   v1

 Other versions for crawler [v4](https://spatie.be/docs/laravel-backup-server/v4) [v3](https://spatie.be/docs/laravel-backup-server/v3) [v2](https://spatie.be/docs/laravel-backup-server/v2) [v1](https://spatie.be/docs/laravel-backup-server/v1)

- [ Introduction ](https://spatie.be/docs/laravel-backup-server/v3/introduction)
- [ Getting a license ](https://spatie.be/docs/laravel-backup-server/v3/getting-a-license)
- [ Installation &amp; setup ](https://spatie.be/docs/laravel-backup-server/v3/installation-setup)
- [ Requirements ](https://spatie.be/docs/laravel-backup-server/v3/requirements)
- [ Upgrading ](https://spatie.be/docs/laravel-backup-server/v3/upgrading)
- [ Questions and issues ](https://spatie.be/docs/laravel-backup-server/v3/questions-issues)
- [ Changelog ](https://spatie.be/docs/laravel-backup-server/v3/changelog)
- [ About us ](https://spatie.be/docs/laravel-backup-server/v3/about-us)
- [ License ](https://spatie.be/docs/laravel-backup-server/v3/license)

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

- [ Creating a destination ](https://spatie.be/docs/laravel-backup-server/v3/taking-backups/creating-a-destination)
- [ Creating a source ](https://spatie.be/docs/laravel-backup-server/v3/taking-backups/creating-a-source)
- [ Taking backups ](https://spatie.be/docs/laravel-backup-server/v3/taking-backups/taking-backups)
- [ The backup process ](https://spatie.be/docs/laravel-backup-server/v3/taking-backups/the-backup-process)
- [ Events ](https://spatie.be/docs/laravel-backup-server/v3/taking-backups/events)
- [ Listing sources and destinations ](https://spatie.be/docs/laravel-backup-server/v3/taking-backups/listing-sources-and-destinations)
- [ Working with backups ](https://spatie.be/docs/laravel-backup-server/v3/taking-backups/working-with-backups)
- [ Creating database backups ](https://spatie.be/docs/laravel-backup-server/v3/taking-backups/creating-database-backups)

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

- [ The clean up process ](https://spatie.be/docs/laravel-backup-server/v3/cleaning-up-backups/the-cleanup-process)
- [ Determining old backups ](https://spatie.be/docs/laravel-backup-server/v3/cleaning-up-backups/determining-old-backups)
- [ Events ](https://spatie.be/docs/laravel-backup-server/v3/cleaning-up-backups/events)

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

- [ The monitoring process ](https://spatie.be/docs/laravel-backup-server/v3/monitoring-the-health-of-all-backups/the-monitoring-process)
- [ Checking health of sources ](https://spatie.be/docs/laravel-backup-server/v3/monitoring-the-health-of-all-backups/checking-health-of-sources)
- [ Checking health of destinations ](https://spatie.be/docs/laravel-backup-server/v3/monitoring-the-health-of-all-backups/checking-health-of-destinations)
- [ Events ](https://spatie.be/docs/laravel-backup-server/v3/monitoring-the-health-of-all-backups/events)

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

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

      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-server                                                                                                                                                                                                                                    `

The backup process
==================

###  On this page

1. [ 1. Ensuring that the source is reachable ](#content-1-ensuring-that-the-source-is-reachable)
2. [ 2. Ensuring that the destination is reachable ](#content-2-ensuring-that-the-destination-is-reachable)
3. [ 3. Determining the destination directory ](#content-3-determining-the-destination-directory)
4. [ 4. Perform pre-backup commands ](#content-4-perform-pre-backup-commands)
5. [ 5. Running the actual backup. ](#content-5-running-the-actual-backup)
6. [ 6. Perform post-backup commands ](#content-6-perform-post-backup-commands)
7. [ 7. Calculate backup size ](#content-7-calculate-backup-size)

When creating a backup, these steps will be performed.

1. Ensuring that the source is reachable
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The package will try to log in the source server and perform the `whoami` command. If that succeeds, the source is considered reachable. If that fails, the backup process will stop.

2. Ensuring that the destination is reachable
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The package will verify if the `disk_name` on the `Destination` matches a disk defined in `config/filesystems.php`. If the disk does not exist, the backup process will stop.

3. Determining the destination directory
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

On the destination disk a directory will be created with this format:

`//
