Add nice to archive commands

Archiving could hammer io/cpu on the server.  Big archives would cause problems.
pull/2077/head
digital-gnome 2017-12-04 14:48:17 -05:00
parent 3f62d1e24d
commit ab08769adb
1 changed files with 4 additions and 4 deletions

View File

@ -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