定制 ruspanzer/ya-disk-backuper 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

ruspanzer/ya-disk-backuper

Composer 安装命令:

composer require ruspanzer/ya-disk-backuper

包简介

README 文档

README

Backuper working with Yandex Disk for creating backups your web sites

1 Install

1.1 With Composer

composer require ruspanzer/ya-disk-backuper

1.2 Standalone

git clone git@github.com:RuSPanzer/ya-disk-backuper.git /path/to/backuper
cd /path/to/backuper
composer install

2 Run

php bin/backuper.php <command> [args]

Creating backups:

php bin/backuper.php backuper:backup path/to/config.json

Decrypting backup:

php bin/backuper.php backuper:decrypt path/to/backup.zip.encrypted --key=<encrypt_key>

For working with encrypted files need mcrypt extension

3 Configuration

For creating backup use command backuper:backup with path to config.json as first argument

Example config.json

{
    "token": "AQAAAAFDsQDgAAN6Z0qSZqekmEFbvf5KTnfT_5r",
    "remote-backups-dir": "/TestBck/",
    "backups": {
        "site-1": {
            "crypt-key": "ThisSuperSecretKey",
            "filesystem": {
                "files": [
                    "/etc/nginx/conf.d/site1.conf"
                ],
                "dirs": [
                    "/srw/www/site1/"
                ],
                "excluded-dirs": [
                    "/srw/www/site1/data/cache"
                ]
            },
            "databases": {
                "site_1": {
                    "host": "localhost",
                    "dbname": "site_1",
                    "user": "site_user",
                    "pass": "EtHewCuh=Peu7Es1Et33E$n!1U4Y@3243q8YdAgCuq8dfd",
                    "exclude-tables": [
                        "api_logs"
                    ]
                },
                "site_1_logs": {
                    "host": "localhost",
                    "dbname": "site_1_logs",
                    "user": "site_user",
                    "pass": "EtHewCuh=Peu7Es1Et33E$n!1U4Y@3243q8YdAgCuq8dfd"
                }
            }
        },
        "my-second-backup": {
            "previous-backups-count": 3,
            "filesystem": {
                "dirs": [
                    "/srv/www/site2/"
                ],
                "excluded-dirs": [
                    "/srw/www/site1/vendor"
                ]
            }
        }
    }
}

Main section:

Param Required Description
token yes Yandex Disk OAuth token for WebDAV API
remote-backups-dir no Remote root dir for backups. By default is /Backups/
backups yes Collections of backup configs. Each backup config must have a name

One backup configuration:

Param Required Description
previous-backups-count no Count of previous backup saving on remote server. If count remote backups more than this param, old backups will be deleted
crypt-key no Key for encrypting backup archive. If empty the backup will not be encrypted
filesystem no Filesystem backup config. For details see bellow
databases no Collections of database configs

Filesystem config:

Param Required Description
files no Array of path to one file
dirs no Array of path to dirs. Nested dirs are included in backup recursively
excluded-dirs no Array of dirs which will be ignored.

Database config:

Backuper working only with MySQL databases

Param Required Description
host yes MySQL database host
dbname yes Database name
user yes Database user
pass yes Password
exclude-tables no Array of tables which will be ignored. Default empty

One backup may include one fylesystem config and one databases config with more databases.

config.json may include more backup configurations

Automatization

Finally add backup command to your crontab

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固