public function execute()
    {
        $successful = true;
        try {
            // Dump all databases
            $this->databaseManager->dump();

            // Backup folders if specified
            $this->logger->info('[dizda-backup] Copying folders.');
            $this->processorManager->copyFolders();

            // Compress everything
            $this->logger->info(sprintf('[dizda-backup] Compressing to archive using %s', $this->processorManager->getName()));
            $this->processorManager->compress();

            // Transfer with all clients
            $this->clientManager->upload($this->processorManager->getArchivePath());
        } catch (\Exception $e) {
            // Write log
            $this->logger->critical('[dizda-backup] Unexpected exception.', array('exception' => $e));

            $successful = false;
        }

        try {
            // If we catch an exception or not, we would still like to try cleaning up after us
            $this->logger->info('[dizda-backup] Cleaning up after us.');
            $this->processorManager->cleanUp();
        } catch (IOException $e) {
            $this->logger->error('[dizda-backup] Cleaning up failed.', array('exception' => $e));

            return false;
        }

        if ($successful) {
            $this->eventDispatcher->dispatch(BackupEvent::BACKUP_COMPLETED, new BackupEvent());
        }

        return $successful;
    }
public function execute()
    {
        $successful = true;
        try {
            // Dump all databases
            $this->databaseManager->dump();

            // Backup folders if specified
            $this->logger->info('[dizda-backup] Copying folders.');
            $this->processorManager->copyFolders();

            // Compress everything
            $this->logger->info(sprintf('[dizda-backup] Compressing to archive using %s', $this->processorManager->getName()));
            $this->processorManager->compress();

            // Transfer with all clients
            $this->clientManager->upload($this->processorManager->getArchivePath());
        } catch (\Exception $e) {
            // Write log
            $this->logger->critical('[dizda-backup] Unexpected exception.', array('exception' => $e));

            $successful = false;
        }

        try {
            // If we catch an exception or not, we would still like to try cleaning up after us
            $this->logger->info('[dizda-backup] Cleaning up after us.');
            $this->processorManager->cleanUp();
        } catch (IOException $e) {
            $this->logger->error('[dizda-backup] Cleaning up failed.', array('exception' => $e));

            return false;
        }

        if ($successful) {
            $this->eventDispatcher->dispatch(BackupEvent::BACKUP_COMPLETED, new BackupEvent());
        }

        return $successful;
    }
public function execute ( ) { $ successful = true ; try { // Dump all databases $ this -> databaseManager -> dump ( ) ; // Backup folders if specified $ this -> logger -> info ( '[dizda-backup] Copying folders.' ) ; $ this -> processorManager -> copyFolders ( ) ; // Compress everything $ this -> logger -> info ( sprintf ( '[dizda-backup] Compressing to archive using %s' , $ this -> processorManager -> getName ( ) ) ) ; $ this -> processorManager -> compress ( ) ; // Transfer with all clients $ this -> clientManager -> upload ( $ this -> processorManager -> getArchivePath ( ) ) ; } catch ( \ Exception $ e ) { // Write log $ this -> logger -> critical ( '[dizda-backup] Unexpected exception.' , array ( 'exception' => $ e ) ) ; $ successful = false ; } try { // If we catch an exception or not, we would still like to try cleaning up after us $ this -> logger -> info ( '[dizda-backup] Cleaning up after us.' ) ; $ this -> processorManager -> cleanUp ( ) ; } catch ( IOException $ e ) { $ this -> logger -> error ( '[dizda-backup] Cleaning up failed.' , array ( 'exception' => $ e ) ) ; return false ; } if ( $ successful ) { $ this -> eventDispatcher -> dispatch ( BackupEvent :: BACKUP_COMPLETED , new BackupEvent ( ) ) ; } return $ successful ; }
Start the backup.

@return bool
Start the backup .