dimsav / backup-engine
此包已被废弃,不再维护。未建议替代包。
一个用于备份项目文件和数据库,并将备份上传到dropbox的库。
v1.0.0-beta1
2014-06-06 13:38 UTC
Requires
- php: >=5.3.0
- andreafabrizi/dropbox-uploader: 0.13
- dimsav/unix-zipper: 1.*
- monolog/monolog: 1.*
Requires (Dev)
- henrikbjorn/phpspec-code-coverage: 1.*@dev
- phpspec/phpspec: 2.0.*@dev
- phpunit/phpcov: *
- phpunit/phpunit: 4.0.*
This package is auto-updated.
Last update: 2024-07-29 03:22:10 UTC
README
尝试使用此替代方案:https://github.com/dimsav/backupish
文档
这是一个库,用php编写,用于备份您项目的文件和数据库。
安装
- 克隆存储库
- 安装composer依赖项:
composer install
- 创建一个文件config/config.php,根据config/config.ini.php进行配置
执行
运行php backup.php
功能
- 可以一次性备份多个项目
- 每个项目可以自定义选择备份目录
- 可以自定义选择排除路径
- 备份文件(.zip)密码保护
- 详细日志保存到服务器并上传到dropbox。
要求
- 由于我们使用系统zip命令,此脚本只能在Unix系统(Linux/Mac)中使用。
- exec()函数应该是可用的,因为我们使用它来压缩我们的备份。
- 执行脚本的用户必须能够写入备份文件夹。
- 如果您想使用dropbox上传器,则需要cURL扩展。
说明
- 将config.ini.php复制到config.php。
- 编辑config.php以定义要备份的项目。
- 使用命令行或Web服务器运行cron.php。
- 见证魔法发生!
定义您的项目易如反掌
/* * Define in this array the projects you wish to backup. * * The key of the array marks the name of the project * and it is used for folder and file names. So better * use alphanumeric characters with slash/underscores. */ "projects" => array( /* * Here we define a project to be backed-up. * For this project, we want to backup only * the database. We use the default host and * port, and we override the username and password. * * For this project we are overriding the default * password with another one. */ "project-1" => array( "database" => array( "name" =>"db-name", "username"=>"db-user", "password"=>"db-pass", ), "password" => "another-secret", ), /* * For this project we backup both some files * and the database. * * We use the default database settings, so we * define only the database name. * * Under "paths" we put a list of absolute paths * of directories or files. * * Under "excludes" we put a list of absolute paths * of directories or files that should not be * included in the compressed backup files. The * contents of these directories will be skipped * recursively. */ "project-2" => array( "database" => array( "name"=>"db-name", ), "paths" => array( "/absolute/project/folder/path", "/absolute/project/file/text.txt", ), "excludes" => array( "/absolute/project/folder/path/cache", "/absolute/project/folder/path/logs", "/absolute/project/folder/path/bigfile.tar", ), ), /* * Here we disable for project-3 the default password, * as we don't want any password for this project. */ "project-3" => array( "paths" => array( "/project/folder", ), "password" => null, ) ),