zarulizham/laravel-database-backup-scheduler
最新稳定版本:1.0.3
Composer 安装命令:
composer require zarulizham/laravel-database-backup-scheduler
包简介
Automate and schedule your Laravel application database to your preferred storage filesystem
README 文档
README
Installation
You can install the package via composer:
composer require zarulizham/laravel-database-backup-scheduler
You can publish and run the migrations with:
php artisan vendor:publish --tag="database-backup-scheduler-migrations"
php artisan migrate
This package relies on spatie/media-library. If your project did not use spatie/media-library package, publish its migration and/or config file.
php artisan vendor:publish --tag="medialibrary-config" php artisan vendor:publish --tag="medialibrary-migrations" php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="database-backup-scheduler-config"
To custom location of backup path, refer Spatie documentation
This is the contents of the published config file. You may modify as per your needs.
return [ 'connections' => [ 'mysql' => [ 'excludeTables' => [], 'storage' => env('FILESYSTEM_DISK', 'local'), ], ], ];
Usage
Place these two scheduler in app/Console/Kernel.php (<= Laravel 10) or routes/console.php (>= Laravel 11)
$schedule->command('db:backup')->dailyAt('00:00') ->environments('production'); $schedule->command('db:backup:prune')->dailyAt('00:00') ->environments('production');
To specify custom retention days for backup, specify --days option on db:backup:prune command. Default 14 days.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
统计信息
- 总下载量: 576
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-22