Skip to content

Backups

Introduction

Backups are important to provide historical snapshots of the application database and files.

Implementation

The base backup functionality is provided by the Spatie package Laravel backup.

Ensure that the server running the backups has mysqldump installed, otherwise the backups will silently fail.

Further ensure that Slack notifications are enabled in config/backup.php and that the SLACK_WEBHOOK_URL is set in .env. Doing so will ensure we are notified of any backup failures or warnings.

Backups Implementation

The package provides all the backup configuration which can be configured in the backup.php config file.

Backup schedules

The backup schedules are run using the Laravel scheduler in kernel.php. This both cleans and runs the relevant backups.

// Backup schedule
$schedule->command('backup:clean')->daily()->at('01:00');
$schedule->command('backup:run')->daily()->at('01:30');