-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,21 @@ | ||
# Laravel database backup package | ||
# Laravel package: backups | ||
|
||
Laravel package that adds a command to back up the database, compress it, and upload to an S3 account. | ||
## Config | ||
|
||
Puts the backup into a folder based on your environmental variables APP_NAME and APP_ENV. | ||
|
||
Filename format: `{APP_ENV}-{APP_NAME}/db-{DATE}-{TIME}-{HASH}.sql.gz` | ||
|
||
## Requirements | ||
|
||
Set up your database config, plus add in your AWS S3 config | ||
|
||
#### Laravel < 5.5.22 | ||
``` | ||
AWS_KEY= | ||
AWS_SECRET= | ||
AWS_REGION= | ||
AWS_BUCKET= | ||
``` | ||
|
||
#### Laravel >= 5.5.22 | ||
``` | ||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_DEFAULT_REGION= | ||
AWS_BUCKET= | ||
``` | ||
|
||
## Scheduling backup | ||
## Examples | ||
|
||
Add the following code to the `schedule` function in your `App\Console\Kernel.php` file: | ||
php artisan backup db | ||
php artisan backup:import env | ||
|
||
$schedule->command('backup:run')->daily(); | ||
## Scheduling backups | ||
|
||
## Loading backups | ||
Add the following code to the `schedule` function in your `App\Console\Kernel.php` file: | ||
|
||
php artisan backup:run --import={source} | ||
$schedule->command('backup db')->daily(); |