From cead8f7bdc9639fdbc6dcfc55be32075f68d7440 Mon Sep 17 00:00:00 2001 From: Tunui Franken Date: Tue, 8 Oct 2024 17:09:15 +0200 Subject: [PATCH] cron.daily: Use `find -delete` instead of `xargs rm -f` The removal of $runtime_ndb and $runtime_hdb in maldet causes a race condition with the daily cron on these files. This correctly hides the cron's output when this race condition occurs. --- cron.daily | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cron.daily b/cron.daily index 44d8902..4ed21b1 100755 --- a/cron.daily +++ b/cron.daily @@ -43,7 +43,7 @@ if [ "$find" ]; then tmpdirs="$tmpdir $varlibpath/sess $varlibpath/quarantine $varlibpath/pub" for dir in $tmpdirs; do if [ -d "$dir" ]; then - $find $dir -type f -mtime +${cron_prune_days} -print0 | xargs -0 rm -f >> /dev/null 2>&1 + $find $dir -type f -mtime +${cron_prune_days} -delete > /dev/null 2>&1 fi done fi