protected function execute(InputInterface $input, OutputInterface $output)
 {
     $logger = $this->getContainer()->get('BnvWebLogger');
     $context = array('source' => 'DeleteJobBackupsCommand');
     $backupsDir = Globals::getSnapshotRoot($input->getArgument('client'), $input->getArgument('job'));
     if (Globals::delTree($backupsDir)) {
         $logger->info('Directory deleted: ' . $backupsDir, array('source' => 'DeleteJobBackupsCommand'));
         return 0;
     } else {
         $logger->err('Error deleting directory: ' . $backupsDir, array('source' => 'DeleteJobBackupsCommand'));
         return 1;
     }
 }
예제 #2
0
 /**
  * Returns the full path of the snapshot directory
  */
 public function getSnapshotRoot()
 {
     return Globals::getSnapshotRoot($this->getId());
 }