[UCLA-LUG] file uid stuff

Dimi Shahbaz dimator@fire.csua.ucla.edu
Thu, 17 Feb 2000 12:44:02 -0800 (PST)


This problem really got me to thinkin... :)
I would approach it like this:  In high likelihood, all the files under a
particular user's home directory are owned by him.  With this assumption,
one could do a recursive chown -R dimator.dimator /home/dimator/

But, there exists the possibility that there are some files in my home
directory that I do not own.  Since these are the exception to the norm, I
would do a 'find'  for these few files, and hang on to them in a temp
file.  Then after I did the recursive chown above, I would deal with the
exceptions in the temp file accordingly, chown'ing each of these to its
appropriate uid/gid.

This has the (small?) advantage of calling less chown's, because your
'find' forks chown on each file seperately, wherease I make one recursive
chown call (which I assume is cheaper to run) and then x (where x is the
number of non-dimator owned files in my path; x << total files under
/home/dimator) chown's on the exception files.

hope all that is clear. :)

Dimi


On Thu, 17 Feb 2000, Justin Boseant wrote:

> anyone know anything you can us in if [ ... ] to check if the uid of a
> file matches a variable?   I'm trying to switch all the user ids on a
> bunch of disks to new ones and my current idea uses 'find ./ -user ...'
> for each disk and loops through each pair of old/new ids.  I know its
> going to be time consuming either way, but is it more efficient to go
> through case statements for each file or go through the file system for
> each case (i.e. recursion vs. iteration, sort of).  
> 
> Any input is greatly apreciated.
> 
> -justin
> 
> p.s. I like ispell, I just don't use it enough
> 
> 
> _______________________________________________
> UCLALUG Linux mailing list - Linux@linux.ucla.edu
> http://linux.ucla.edu/mailman/listinfo/linux
>