Package Data | |
---|---|
Maintainer Username: | luiz.albertoni |
Maintainer Contact: | luiz.albertoni@gmail.com (luiz.albertoni) |
Package Create Date: | 2017-08-07 |
Package Last Update: | 2018-09-07 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-01-29 15:02:14 |
Package Statistics | |
---|---|
Total Downloads: | 3,880 |
Monthly Downloads: | 25 |
Daily Downloads: | 4 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
The DynamicMysqlDatabaseBackup is a Laravel package to dynamically take a dump from your Mysql database and storage to a filesystem (local filesystems, Amazon S3, and Rackspace Cloud Storage). It also allow the user to configurate which environment (local, dev, stage, prod) it should take a dump, permit the user storage the dump compressing to Zip format and the user is able to configure how many days the dump file should remain in the storage, so it dynamically storage and remove the backup files through Laravel's Scheduler.
Composer install
composer require luiz-albertoni/dynamic-mysql-db-backup
Edit app/config/app.php to add the DynamicMysqlDumpServiceProvider under the 'providers' Array
Albertoni\DynamicMysqlDataBaseBackup\DynamicMysqlDumpServiceProvider::class,
Publish the configuration
php artisan vendor:publish --provider="Albertoni\DynamicMysqlDataBaseBackup\DynamicMysqlDumpServiceProvider" --tag='config' --force
Set Scheduler to run the package. Add the code below in App\Console\Kernel inside the schedule method.
$schedule->call(function () {
DynamicMysqlFacade::runDump();
})->daily();
Config file name : dynamic-mysql-dump.php
<?php
return [
/*
|--------------------------------------------------------------------------
| Dynamic Mysql Dump Configuration
|--------------------------------------------------------------------------
*/
'store_days' => 5,
'specific_storage_type' => 'local',
'specific_storage_path' => '',
'use_zip' => true,
'use_for_app_env' => ['local', 'dev', 'prod'],
];
What means each configuration var?
store_days : Number of days which we want to hold the dump file. Default value = 5
specific_storage_type: Which filesystem we are using for storage teh dump file. Default value = local
specific_storage_path: Specific path that we want to store the dump file in our filesystem. Default value = ''
use_zip: Signal to inform if it should be compress to the Zip format
use_for_app_env: Specific under which enviroment the package should take a dump
To use this package we are assuming:
In the Scheduler Class do not forget to: