protected function preRestoreBackupTask(
        $worker,
        AbstractAuth $auth,
        $remote,
        $opts = ['files' => false, 'data' => false]
    ) {
        if (!$opts['files'] && !$opts['data']) {
            $opts['files'] = true;
            $opts['data'] = true;
        }
        if ($opts['files']) {
            $removeFiles = 'rm -rf';
            if (!$this->fileBackupSubDirs) {
                $removeFiles .= ' ./* ./.??*';
            }
            foreach ($this->fileBackupSubDirs as $subdir) {
                $removeFiles .= ' ' . $subdir . '/* ' . $subdir . '/.??*';
            }

            return $this->taskSsh($worker, $auth)
                ->remoteDirectory($remote['filesdir'], true)
                // Files dir can be pretty big on large sites.
                ->timeout($this->getTimeoutSetting('pre_restore_remove_files'))
                ->exec($removeFiles);
        }

        return false;
    }
protected function preRestoreBackupTask(
        $worker,
        AbstractAuth $auth,
        $remote,
        $opts = ['files' => false, 'data' => false]
    ) {
        if (!$opts['files'] && !$opts['data']) {
            $opts['files'] = true;
            $opts['data'] = true;
        }
        if ($opts['files']) {
            $removeFiles = 'rm -rf';
            if (!$this->fileBackupSubDirs) {
                $removeFiles .= ' ./* ./.??*';
            }
            foreach ($this->fileBackupSubDirs as $subdir) {
                $removeFiles .= ' ' . $subdir . '/* ' . $subdir . '/.??*';
            }

            return $this->taskSsh($worker, $auth)
                ->remoteDirectory($remote['filesdir'], true)
                // Files dir can be pretty big on large sites.
                ->timeout($this->getTimeoutSetting('pre_restore_remove_files'))
                ->exec($removeFiles);
        }

        return false;
    }
protected function preRestoreBackupTask ( $ worker , AbstractAuth $ auth , $ remote , $ opts = [ 'files' => false , 'data' => false ] ) { if ( ! $ opts [ 'files' ] && ! $ opts [ 'data' ] ) { $ opts [ 'files' ] = true ; $ opts [ 'data' ] = true ; } if ( $ opts [ 'files' ] ) { $ removeFiles = 'rm -rf' ; if ( ! $ this -> fileBackupSubDirs ) { $ removeFiles .= ' ./* ./.??*' ; } foreach ( $ this -> fileBackupSubDirs as $ subdir ) { $ removeFiles .= ' ' . $ subdir . '/* ' . $ subdir . '/.??*' ; } return $ this -> taskSsh ( $ worker , $ auth ) -> remoteDirectory ( $ remote [ 'filesdir' ] , true ) // Files dir can be pretty big on large sites. -> timeout ( $ this -> getTimeoutSetting ( 'pre_restore_remove_files' ) ) -> exec ( $ removeFiles ) ; } return false ; }
Pre restore backup task.

@param string $worker
The server to install the site on.
@param \DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth $auth
The ssh authentication to connect to the server.
@param array $remote
The remote settings for this server.

@return bool|\Robo\Contract\TaskInterface
The pre restore backup task, false if no pre restore backup tasks need
to run.
Pre restore backup task .