jeffgepiga/dbfilebackup 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jeffgepiga/dbfilebackup

Composer 安装命令:

composer require jeffgepiga/dbfilebackup

包简介

laravel package to backup/restore files and database.

README 文档

README

Latest Version on Packagist Total Downloads

Laravel BackupManager

Simple laravel package to backup/restore files and database.

Screenshot

Main Window

Requirements

  • PHP >= 7.4
  • Laravel 8-10
  • mysql (to restore database)
  • mysqldump (to backup database)
  • tar (to backup/restore files)
  • zcat (to extract database archive)

Please make sure above binaries are added to PATH environment variable or you can specify full path to them in config file.

Installation

Via Composer

$ composer require jeffgepiga/dbfilebackup

Publish package's files by running below command:

$ php artisan vendor:publish --provider="JeffGepiga\BackupManager\ServiceProvider"

It should publish config/backupmanager.php.php config file and migration file.

Run php artisan migrate to create backup verifier (verifybackup)) table.

Finally setup options in config/backupmanager.php file and open the backup manager at url you have specified in route option eg http//yourapp.com/backupmanager, you should now see interface of BackupManager.

See config/backupmanager.php file for more information about backup settings.

Setting Up Automatic Backups

To setup automatic backups, place following in app/Console/Kernel.php file:

$schedule->command('backupmanager:create')->daily();

Although packages provides GUI interface to manage backups, following commands are also available:

  backupmanager:create                  Creates backup of files and/or database.
  backupmanager:list                    Shows list of backups taken.
  backupmanager:restore                 Restores a backup already taken.
  backupmanager:create --only="db"      Creates backup of database only.
  backupmanager:create --only="files"   Creates backup of files only.

Saving Backups to Other Disks

By default this package saves backups to local disk but you can use built-in feature of laravel filesystem to save backups to other disks too. Let's say you want to upload to different server for which you have ftp credentials, you need to update those ftp credentials into laravel's config/filesystems.php file under ftp disk setting. Once you have done that, in backup manager config file (config/backupmanager.php) specify your disk to be ftp instead of local eg:

// define disk options
'disk' => 'ftp',

instead of

 'disk' => 'local',

Now backup files will be saved on your ftp location instead of locally.

How Restore is verified

Even though there is no 100% way to verify restores, yet for files we create and verify restore feature by putting some contents into backup-verify file before and after restore. Similarly, we verify database restore by putting some contents into verifybackup table before and after restore. In both cases, contents of that file and database table are different at the time of backup and restore.

Disclaimer

This package was created for our needs and works for us however no guarantee is provided in terms of its functionality especially restore feature which can not be 100% verified because of the way restore feature works. So use this package at your own risk.

Credits

License

Please see the license file for more information.

统计信息

  • 总下载量: 29
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固