Speed up mass-chown

Speed up mass-chown

From aef8682f1e9961d82b98aab87c7e47e0f08a6c52 Mon Sep 17 00:00:00 2001
From: Matt Palmer <mpalmer@hezmatt.org>
Date: Mon, 27 Aug 2018 10:50:23 +1000
Subject: [PATCH] Speed up mass-chown


diff --git a/templates/web.template.yml b/templates/web.template.yml
index a0b7fa3..e71ff7e 100644
--- a/templates/web.template.yml
+++ b/templates/web.template.yml
@@ -147,7 +147,7 @@ run:
       cmd:
         # ensure we are on latest bundler
         - gem update bundler
-        - chown -R discourse $home
+        - find $home ! -user discourse -exec chown discourse {} \+
 
   - exec:
       cd: $home

GitHub

2 Likes

Nice trick I like it :star_struck: