mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
backup add feature: upload to google drive
This commit is contained in:
@@ -12,14 +12,14 @@ class BackuAll extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'backup:all';
|
||||
protected $signature = 'backup:all {--upload-to-google-drive}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Backup all data, include web root and database';
|
||||
protected $description = 'Backup all data, include web root and database. options: --upload-to-google-drive';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
@@ -38,9 +38,13 @@ class BackuAll extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$uploadToGoogleDrive = $this->option('upload-to-google-drive');
|
||||
$rep = new ToolRepository();
|
||||
$result = $rep->backupAll();
|
||||
$log = sprintf('[%s], %s, result: %s', REQUEST_ID, __METHOD__, var_export($result, true));
|
||||
$result = $rep->backupAll($uploadToGoogleDrive);
|
||||
$log = sprintf(
|
||||
'[%s], %s, uploadToGoogleDrive: %s, result: %s',
|
||||
REQUEST_ID, __METHOD__, var_export($uploadToGoogleDrive, true), var_export($result, true)
|
||||
);
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ class Test extends Command
|
||||
// $rep->assignCronjob();
|
||||
// $r = $rep->cronjobCheckout();
|
||||
$disk = Storage::disk('google_dirve');
|
||||
$r = $disk->files();
|
||||
$r = $disk->put('/', base_path('composer.json'));
|
||||
dd($r);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user