demi / dropbox-backup
Yii2控制台命令,用于创建网站备份并将其上传到您的Dropbox帐户
2.0.0
2020-07-09 01:00 UTC
Requires
- php: >=7.0.0
- demi/backup: *
- spatie/dropbox-api: ~1.0
- yiisoft/yii2: *
Suggests
- php-64bit: The Dropbox SDK uses 64-bit integers, this could cause problems because some of the numbers (file sizes, quota, etc) can be larger than 32-bit int. http://stackoverflow.com/a/864402
README
Yii2控制台命令,用于创建网站备份并将其上传到您的Dropbox帐户(Dropbox API v2)。
安装
运行
composer require "demi/dropbox-backup" "~2.0"
配置
要开始使用,请配置备份组件 (您无需安装它)。
然后创建新的Dropbox应用程序 并获取Dropbox的AppKey和AppSecret。
配置/console/config/main.php
return [ 'controllerMap' => [ 'backup' => [ 'class' => 'demi\backup\dropbox\BackupController', // Name of \demi\backup\Component in Yii components. // Default Yii::$app->backup 'backupComponent' => 'backup', // Dropbox app identifier 'dropboxAppKey' => '65pwea8lqgbq5dm', // Dropbox app secret 'dropboxAppSecret' => 'k2x0sl8a7wfj7h9', // Access token for user which will be get up backups. // To get this navigate to // https://www.dropbox.com/developers/apps/info/<AppKey> // and press OAuth 2: Generated access token button. 'dropboxAccessToken' => 'kFflkUk7K3AAAAAAAAAAEh2tNeQbPbOX8Z11wk0rSdFfYMb5B5VX6kTvkcWz5N8R', // Path in the dropbox folder where would be saved backups 'dropboxUploadPath' => '/', // If true: will be deleted files in the // dropbox when $expiryTime has come 'autoDelete' => true, // Number of seconds after which the file is // considered deprecated and will be deleted. 'expiryTime' => 30 * 86400, // 30 days // @see more options here [\console\controllers\BackupController] ], ], ];
用法
运行控制台命令
php yii backup
它将生成当前网站的备份(基于备份组件)并将其上传到您的Dropbox帐户。