Beispiel #1
0
 /**
  * @param $destinationFile
  * @return string
  */
 protected function tunneledDatabaseExport($destinationFile)
 {
     $command = 'ssh -l ##SSHUSER## ##SSHHOST## "mysqldump --add-drop-table -u ##MYSQLUSER## ' . '-p##MYSQLPASS## ##MYSQLDB## | gzip -3 -c" > ##DESTFILE##';
     $result = $this->shellService->execute($command, array('SSHUSER' => $this->environment->getSshUsername(), 'SSHHOST' => $this->environment->getSshHost(), 'MYSQLUSER' => $this->environment->getUsername(), 'MYSQLPASS' => $this->environment->getPassword(), 'MYSQLDB' => $this->environment->getDatabase(), 'DESTFILE' => $destinationFile . '.gz'));
     $this->fileService->gunzip($destinationFile . '.gz', $destinationFile);
     return [$result];
 }