Skip to content

Latest commit

 

History

History
83 lines (58 loc) · 1.59 KB

quickstart.md

File metadata and controls

83 lines (58 loc) · 1.59 KB

Quickstart

Five minutes, from nothing to a restorable backup.

1. Install

composer require elbanbydev/backkeep
php artisan vendor:publish --tag=backkeep-config
php artisan vendor:publish --tag=backkeep-migrations
php artisan migrate

2. Point it at a folder

In .env:

BACKKEEP_LOCAL_PATH=/var/backups/my-app
BACKKEEP_LOCAL_SECONDARY_PATH=/mnt/external/my-app

The second path is optional. When it is set, every backup is copied there too, so a disk failure on the first one is survivable.

3. Check the server

php artisan backkeep:test

Green here means: folder writable, zip present, database reachable, key set if you asked for encryption.

4. Take one

php artisan backkeep:run full
php artisan backkeep:list

You should see one row, completed, with a size and a path.

5. Prove the restore works

Do this now, on a copy, not at 3am on the real thing.

php artisan backkeep:restore 1 --type=full --force

If that works, you have a backup. If it does not, you found out on a Tuesday afternoon.

6. Put it on a schedule

BACKKEEP_SCHEDULE=true
BACKKEEP_SCHEDULE_FREQUENCY=daily
BACKKEEP_SCHEDULE_HOUR=22
BACKKEEP_SCHEDULE_MINUTE=15
BACKKEEP_MAX_BACKUPS=7

Your existing php artisan schedule:run cron takes it from there. With BACKKEEP_MAX_BACKUPS=7 and a daily run you keep a week, and the eighth deletes the first.

7. Know when it breaks

BACKKEEP_MAIL=true
BACKKEEP_MAIL_TO=you@example.com
php artisan backkeep:notify-test

A backup nobody hears about is a backup nobody checks.