Implementato sistema di backup cbs2

Signed-off-by: Riccardo Di Dato <r.didato@asdynamics.it>
This commit is contained in:
Riccardo Di Dato
2017-08-11 18:14:21 +02:00
parent 66b1040782
commit d653f36a4b
7 changed files with 81 additions and 6 deletions
+11 -5
View File
@@ -19,12 +19,18 @@ class SendBackupTask extends Task {
$backDir = $config->paths->backup."/mongoDump";
SystemController::shellExec("mongodump","-d $dbName -o $backDir");
$archive = $config->paths->tmp."/backup.tar.gz";
if (SFSManager::fileExists($archive)){
SFSManager::deleteFile($archive);
}
$backupKeyFile = $config->cbs2->keyFile;
$backupServerPort = $config->cbs2->serverPort;
$storageDir = $config->paths->storage;
SFSManager::createArchive($config->paths->storage, $archive);
SystemController::shellExec('rsync -avx --rsh="ssh -i '.$backupKeyFile.' -p'.$backupServerPort.'" '.$storageDir.' backupClient@cbs.asdynamics.com:/');
// $archive = $config->paths->tmp."/backup.tar.gz";
// if (SFSManager::fileExists($archive)){
// SFSManager::deleteFile($archive);
// }
// SFSManager::createArchive($config->paths->storage, $archive);
// GlobalVariables::get("backupClient")->sendBackup("backup_".date("d-m-Y").".tar.gz",$archive);
}
}