[Gllug] Recursively setting file permissions

Dylan dylan at dylan.me.uk
Sun May 2 21:48:12 UTC 2004


Hi All,

I've just finished upgrading my server (almost) and have managed to 
scramble the permissions on about 22000 files!

In copying them from various source fs's to one large partition, they 
all got to have ownership root:root and permission rw-r--r-- for files 
and rwxr-xr-x for directories. I issued a 

chown -R dylan:dandg /top/level/directory

which has successfully set all files and directories to the correct 
ownership. I want the permissions to be rwxrwx--- and rw-rw---- for 
dirs and files respectively but of course

chmod -R rwxrwx--- /top/level/directory

will set all files as executable which is not on since none of them are! 
So what do I need to do to get the correct permissions? In other words 
- how can I get chmod to discriminate between files and directories?

Also, is it possible to have new files and directories to automatically 
have the correct permissions? (I know about umask, but want to retain 
the default for home directories, just have the rwxrwx--- for this 
shared data area.

Cheers
Dylan

-- 
"I see your Schwartz is as big as mine" 
                                  -Dark Helmet
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list