It's worth mentioning that find -exec this way forks a separate copy of find
for each file. You'll notice how much slower this is on a really large set of
files (possibly larger than yours). If you have a recursion-capable chown it's
quicker to use chown -R.
On Wed, Nov 02, 2011 at 01:30:04AM -0700, Robert Atkins wrote:
> Thanks for your solution Luke, this is much faster. For future
> reference here's the modification I made (there were a couple of typos
> and/or I've got a different dialect of find):
>
> exec { "enforce ${jetty_install_dir} permissions":
> command => "/usr/bin/find ${jetty_install_dir} ! -user jetty -o ! -
> group users -exec chown jetty:users {} \\;",
> onlyif => "/usr/bin/test $(/usr/bin/find ${jetty_install_dir} ! -
> user jetty -o ! -group users | wc -l) -gt 0",
> }
>
> Cheers, Robert.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.