cyberwizard/dbsafeguard 问题修复 & 功能扩展

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

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

cyberwizard/dbsafeguard

Composer 安装命令:

composer require cyberwizard/dbsafeguard

包简介

A Laravel package for safeguarding your database with easy-to-use backup commands.

README 文档

README

DBSafeguard Database Backup is a simple Laravel package that provides a convenient command-line interface to backup your database.

Installation

  1. Install the package via Composer:
composer require cyberwizard/dbsafeguard:dev-main
  1. Usage:

To manually backup your database, run the following command:

php artisan backup:db

The backup file will be stored in the storage/app/backups directory with a timestamped filename.

  1. Schedule Backups:

You can schedule automatic backups by adding the following entry to your Laravel task scheduler (usually defined in the App\Console\Kernel class):

$schedule->command('backup:db')->daily();

This will run the database backup command daily. Adjust the schedule as needed. Here are some examples:

  • $schedule->command('backup:db')->daily(); - Run daily at midnight.
  • $schedule->command('backup:db')->dailyAt('3:00'); - Run daily at 3:00 AM.
  • $schedule->command('backup:db')->twiceDaily(1, 13); - Run twice a day at 1:00 AM and 1:00 PM.

Configuration

The package uses environment variables (DB_DATABASE, DB_USERNAME, DB_PASSWORD) to connect to the database. Ensure these variables are correctly set in your .env file.

Author

Cyberwizard

Contact: eminibest@gmail.com

License

This package is open-sourced software licensed under the MIT license.

Extra

Installation

You can install this package directly from the GitHub repository. Follow the steps below:

  1. Open your project's composer.json file.

  2. Add the GitHub repository to the repositories key:

    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/cyberwizard-dev/DBSafeGuard/"
        }
    ],
  3. In the require section, specify the package name and version:

    "require": {
        "cyberwizard/DBSafeGuard/": "dev-main"
    },
  4. Run the following command to install the package:

    composer install

    This will fetch the package directly from the GitHub repository and install it in your project.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-20