FIX Backup using the low memory mode

This commit is contained in:
Laurent Destailleur 2022-11-15 19:02:56 +01:00
parent a5aab68958
commit 2f3cc7ce59

View File

@ -360,23 +360,23 @@ class Utils
} }
} else { } else {
if ($compression == 'none') { if ($compression == 'none') {
$fullcommandclear .= " > ".$outputfile; $fullcommandclear .= " | grep -v 'Warning: Using a password on the command line interface can be insecure.' > ".$outputfile;
$fullcommandcrypted .= " > ".$outputfile; $fullcommandcrypted .= " | grep -v 'Warning: Using a password on the command line interface can be insecure.' > ".$outputfile;
$handle = 1; $handle = 1;
} elseif ($compression == 'gz') { } elseif ($compression == 'gz') {
$fullcommandclear .= " | gzip > ".$outputfile; $fullcommandclear .= " | grep -v 'Warning: Using a password on the command line interface can be insecure.' | gzip > ".$outputfile;
$fullcommandcrypted .= " | gzip > ".$outputfile; $fullcommandcrypted .= " | grep -v 'Warning: Using a password on the command line interface can be insecure.' | gzip > ".$outputfile;
$paramcrypted.=" | gzip"; $paramcrypted.=" | grep -v 'Warning: Using a password on the command line interface can be insecure.' | gzip";
$handle = 1; $handle = 1;
} elseif ($compression == 'bz') { } elseif ($compression == 'bz') {
$fullcommandclear .= " | bzip2 > ".$outputfile; $fullcommandclear .= " | grep -v 'Warning: Using a password on the command line interface can be insecure.' | bzip2 > ".$outputfile;
$fullcommandcrypted .= " | bzip2 > ".$outputfile; $fullcommandcrypted .= " | grep -v 'Warning: Using a password on the command line interface can be insecure.' | bzip2 > ".$outputfile;
$paramcrypted.=" | bzip2"; $paramcrypted.=" | grep -v 'Warning: Using a password on the command line interface can be insecure.' | bzip2";
$handle = 1; $handle = 1;
} elseif ($compression == 'zstd') { } elseif ($compression == 'zstd') {
$fullcommandclear .= " | zstd > ".$outputfile; $fullcommandclear .= " | grep -v 'Warning: Using a password on the command line interface can be insecure.' | zstd > ".$outputfile;
$fullcommandcrypted .= " | zstd > ".$outputfile; $fullcommandcrypted .= " | grep -v 'Warning: Using a password on the command line interface can be insecure.' | zstd > ".$outputfile;
$paramcrypted.=" | zstd"; $paramcrypted.=" | grep -v 'Warning: Using a password on the command line interface can be insecure.' | zstd";
$handle = 1; $handle = 1;
} }
} }
@ -460,7 +460,7 @@ class Utils
} }
} }
if (!$lowmemorydump) {
if ($compression == 'none') { if ($compression == 'none') {
fclose($handle); fclose($handle);
} elseif ($compression == 'gz') { } elseif ($compression == 'gz') {
@ -470,6 +470,7 @@ class Utils
} elseif ($compression == 'zstd') { } elseif ($compression == 'zstd') {
fclose($handle); fclose($handle);
} }
}
if (!empty($conf->global->MAIN_UMASK)) { if (!empty($conf->global->MAIN_UMASK)) {
@chmod($outputfile, octdec($conf->global->MAIN_UMASK)); @chmod($outputfile, octdec($conf->global->MAIN_UMASK));