Scripts: Remove -rf option in rm command to avoid going too far on errors - refs BT#19673

pull/4213/head
Yannick Warnier 4 years ago
parent 33e1e02b63
commit 6cf394f6fa
  1. 4
      tests/scripts/delete_old_message_attachments.php

@ -78,7 +78,7 @@ while ($message = Database::fetch_assoc($res)) {
//echo " File found".PHP_EOL;
$totalSize += filesize($userBasePath.$filePath);
if ($simulate == false) {
exec('rm -rf '.$userBasePath.$filePath);
exec('rm '.$userBasePath.$filePath);
$res = Database::query($sqlDeleteAttach.$message['maid']);
} else {
echo "Would delete ".$userBasePath.$filePath.PHP_EOL;
@ -94,7 +94,7 @@ while ($message = Database::fetch_assoc($res)) {
//echo " File found in receiver's path".PHP_EOL;
$totalSize += filesize($userBasePath.$filePath);
if ($simulate == false) {
exec('rm -rf '.$userBasePath.$filePath);
exec('rm '.$userBasePath.$filePath);
$res = Database::query($sqlDeleteAttach.$message['maid']);
} else {
echo "Would delete ".$userBasePath.$filePath.PHP_EOL;

Loading…
Cancel
Save