[CentOS] check permissions of all my files! -- find example, short script (NOTES)

Tue May 17 20:57:35 UTC 2005
Bryan J. Smith <b.j.smith at ieee.org>

On Tue, 2005-05-17 at 15:52 -0500, Bryan J. Smith wrote:
> 	find "${mypath}" -maxdepth 0 -printf "chown %u:%g %p\n"
> 	find "${mypath}" -maxdepth 0 -printf "chmod %m %p\n"

NOTE, if you want to save by UID/GID, change %u:%g to %U:%G.

Also, there is a way to save/apply ACLs as well (using getfacl/setfacl).
I've been using a variant of this script to save all ACLs into a script
when backing up, just in case the backup approach doesn't save them
(e.g., I typically limit my use of ACLs to XFS, because xfsdump
preserves them, but just in case I use something that cant').


-- 
Bryan J. Smith                                 b.j.smith at ieee.org 
----------------------------------------------------------------- 
Beware of those who define their preference in terms of hate of
another option, and not on the positive merits of their selection