From b35df0e3c9a75fbf02b4fc6a35a5edb193f292fe Mon Sep 17 00:00:00 2001 From: uffhitech Date: Thu, 26 Aug 2021 10:41:13 +0300 Subject: [PATCH] chwebown with xargs old way is very slow - takes 15 minutes instead of 5 seconds (new way) on 602990 of file 43 Gb in size even on NVMe --- files/usr/local/sbin/chwebown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/usr/local/sbin/chwebown b/files/usr/local/sbin/chwebown index ffa352a..6cbf290 100755 --- a/files/usr/local/sbin/chwebown +++ b/files/usr/local/sbin/chwebown @@ -1,4 +1,4 @@ #!/bin/bash ionice -c 3 chown -R www-data:www-data $1 -ionice -c 3 find $1 -type d -exec chmod 775 {} \; -ionice -c 3 find $1 -type f -exec chmod 664 {} \; +ionice -c 3 find $1 -type d -print0 | xargs -0 chmod 775 +ionice -c 3 find $1 -type f -print0 | xargs -0 chmod 644