From 2deb99ace9d6e5f42f2b9778a8dc3164dd00e6e5 Mon Sep 17 00:00:00 2001 From: Florian Wallner Date: Sat, 7 Jan 2023 22:19:49 +0100 Subject: [PATCH] Improve performance of the "fix permissions" step in ncp-update-nc The "fix permissions" step is really slow when the nextcloud folder contains a lot of data. In a docker setup the data directory is in nextcloud/data so the folder can be really big. Even on my small test setup the "fix permissions" step took more than 20 minutes. Using "chmod -R ..." reduces the time to around 20 seconds. Signed-off-by: Florian Wallner --- bin/ncp-update-nc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc index 60e8486f0..4218fd47d 100755 --- a/bin/ncp-update-nc +++ b/bin/ncp-update-nc @@ -179,8 +179,9 @@ trap rollback INT TERM HUP ERR #################### echo "Fix permissions..." chown -R www-data:www-data nextcloud -find nextcloud/ -type d -exec chmod 750 {} \; -find nextcloud/ -type f -exec chmod 640 {} \; + +# this command sets the permissions to 750 for directories and to 640 for files +chmod -R a-x,u=rwX,g=rX,o= nextcloud # upgrade ####################