Chown Recursively excluding a directory.

asked 2018-08-02 22:36:27 -0500

Murugan R gravatar image

Murugan Ramaswamy murugan0723@gmail.com 9:04 AM (0 minutes ago) to me

My requirement is to run chown command recursively for a path except for one directory in that path.

For example: Path:/opt/test/ Except for path:/opt/test/new/exclude/

How can I achieve this in puppet:

I can do this with Linux command like the below one:

"find /opt/test/ -not -path "/exclude/" -exec chown user1:group1 { } \;"

But I'm not able to use the option -not -path in puppet , Can someone help me on how to achieve this scenario in puppet.

edit retag flag offensive close merge delete