Five minutes, from nothing to a restorable backup.
composer require elbanbydev/backkeep
php artisan vendor:publish --tag=backkeep-config
php artisan vendor:publish --tag=backkeep-migrations
php artisan migrateIn .env:
BACKKEEP_LOCAL_PATH=/var/backups/my-app
BACKKEEP_LOCAL_SECONDARY_PATH=/mnt/external/my-appThe second path is optional. When it is set, every backup is copied there too, so a disk failure on the first one is survivable.
php artisan backkeep:testGreen here means: folder writable, zip present, database reachable, key set if you asked for encryption.
php artisan backkeep:run fullphp artisan backkeep:listYou should see one row, completed, with a size and a path.
Do this now, on a copy, not at 3am on the real thing.
php artisan backkeep:restore 1 --type=full --forceIf that works, you have a backup. If it does not, you found out on a Tuesday afternoon.
BACKKEEP_SCHEDULE=true
BACKKEEP_SCHEDULE_FREQUENCY=daily
BACKKEEP_SCHEDULE_HOUR=22
BACKKEEP_SCHEDULE_MINUTE=15
BACKKEEP_MAX_BACKUPS=7Your 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.
BACKKEEP_MAIL=true
BACKKEEP_MAIL_TO=you@example.comphp artisan backkeep:notify-testA backup nobody hears about is a backup nobody checks.