Ejemplo n.º 1
0
 /**
  * @param string      $devicePath
  * @param string|null $targetDirectory
  * @throws CM_Cli_Exception_Internal
  */
 public function verifyBackup($devicePath, $targetDirectory = null)
 {
     if (null === $targetDirectory) {
         $targetDirectory = $this->_getBackupManager()->getBucketName();
     }
     $device = new S3Export_Device($devicePath);
     if (!$device->hasPartitions()) {
         $device->fixPartitioning();
     }
     $device->mount();
     $filesystemBackupRootPath = $device->getMountpoint()->joinPath($targetDirectory)->getPathOnLocalFilesystem();
     $adapter = new CM_File_Filesystem_Adapter_Local($filesystemBackupRootPath);
     $filesystemBackup = new CM_File_Filesystem($adapter);
     $this->_getBackupManager()->verifyExport($this->_getStreamOutput(), $filesystemBackup);
     $device->unmount();
 }