Refactor the rsync permissions and webgroup handling, to avoid errors during tear down.