Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to map all filesystem permissions ( ACL only )

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
jlambrecht
Posts: 374
Joined: 2008-02-01 16:21

How to map all filesystem permissions ( ACL only )

#1 Post by jlambrecht »

Because i ran into this stupid stupid situation of having all files on a system chown and chmod ( because .* expands .. into the upper directory )

The below command should be ran as root or other privileged user if need be. This will print all ACL based information on the filesystem and dump it into a compressed file. Take note the compression factor is HUGE. I saw a 12MB file be compressed into a 512KB .gz file.

find / -printf path,%h,filename,%f,symlink,%l,userinfo,%u,%U,groupinfo,%g,%G,octaperms,%#m,hardlinks,%n"\n" -path /proc -prune -path /sys -prune | gzip > myfs.txt.gz

* the "-path /..... -prune" servers to exclude /proc and /sys from being indexed

Take note the process is far from efficient and may require quite a bit of time to complete. After this however restoring the filepermissions as recorded at the time this .gz was created should be trivial. Since this is a named CSV it should be quite easy to parse, feel free to leave out any of the non % values upto "\n" for faster result. The full option as above took about 13 minutes to create a db of 404509 files, the db size is 2.7M
Embrace what you're not certain off,
keep an eye on what you're confident about.

Post Reply