Add nice to archive commands
Archiving could hammer io/cpu on the server. Big archives would cause problems.pull/2077/head
parent
3f62d1e24d
commit
ab08769adb
|
@ -908,9 +908,9 @@ function exportEvents( $eids, $exportDetail, $exportFrames, $exportImages, $expo
|
|||
$archive = ZM_DIR_EXPORTS."/".$export_root.".tar.gz";
|
||||
@unlink( $archive );
|
||||
if ($exportStructure == 'flat') { //strip file paths if we choose
|
||||
$command = "tar --create --gzip --file=".escapeshellarg($archive)." --files-from=".escapeshellarg($listFile)." --xform='s#^.+/##x'";
|
||||
$command = "nice -10 tar --create --gzip --file=".escapeshellarg($archive)." --files-from=".escapeshellarg($listFile)." --xform='s#^.+/##x'";
|
||||
} else {
|
||||
$command = "tar --create --gzip --file=".escapeshellarg($archive)." --files-from=".escapeshellarg($listFile);
|
||||
$command = "nice -10 tar --create --gzip --file=".escapeshellarg($archive)." --files-from=".escapeshellarg($listFile);
|
||||
}
|
||||
exec( $command, $output, $status );
|
||||
if ( $status )
|
||||
|
@ -926,9 +926,9 @@ function exportEvents( $eids, $exportDetail, $exportFrames, $exportImages, $expo
|
|||
$archive = ZM_DIR_EXPORTS."/".$export_root.".zip";
|
||||
@unlink( $archive );
|
||||
if ($exportStructure == 'flat') {
|
||||
$command = "cat ".escapeshellarg($listFile)." | zip -q -j ".escapeshellarg($archive)." -@";
|
||||
$command = "cat ".escapeshellarg($listFile)." | nice -10 zip -q -j ".escapeshellarg($archive)." -@";
|
||||
} else {
|
||||
$command = "cat ".escapeshellarg($listFile)." | zip -q ".escapeshellarg($archive)." -@";
|
||||
$command = "cat ".escapeshellarg($listFile)." | nice -10 zip -q ".escapeshellarg($archive)." -@";
|
||||
}
|
||||
//cat zmFileList.txt | zip -q zm_export.zip -@
|
||||
//-bash: zip: command not found
|
||||
|
|
Loading…
Reference in New Issue