diff --git a/src/Command/CommandBase.php b/src/Command/CommandBase.php index 70e64e3d0..2f17d3788 100644 --- a/src/Command/CommandBase.php +++ b/src/Command/CommandBase.php @@ -1692,10 +1692,10 @@ protected function createMySqlDumpOnLocal(string $dbHost, string $dbUser, string $outputCallback('out', "Dumping MySQL database to $localFilepath on this machine"); } if ($this->localMachineHelper->commandExists('pv')) { - $command = "MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | pv --rate --bytes | gzip -9 > $localFilepath"; + $command = "bash -c \"set -o pipefail; MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | pv --rate --bytes | gzip -9 > $localFilepath\""; } else { $this->io->warning('Install `pv` to see progress bar'); - $command = "MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | gzip -9 > $localFilepath"; + $command = "bash -c \"set -o pipefail; MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | gzip -9 > $localFilepath\""; } $process = $this->localMachineHelper->executeFromCmd($command, $outputCallback, null, ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));