[mdlug] chown -R recovery + sanity check

Michael ORourke mrorourke at earthlink.net
Wed Dec 17 08:26:02 EST 2008


Sure... you can do something like that, but the directory/file permissions are already broken.  So if you run the comand I suggested, and it fails, you are not any worse off.  :-)

-Mike
  ----- Original Message ----- 
  From: mdlug at wowway.com 
  To: mdlug at mdlug.org 
  Sent: Wednesday, December 17, 2008 8:02 AM
  Subject: [mdlug] chown -R recovery + sanity check


  Hello again, one more thing:  Is there a way to do it so that I can stop and
  check the results on first couple and then let it go?

  This is what I was thinking, in psuedocode

  For each entry in `ypcat passwd`
        $USERNAME = awk <awk command to extract username>
        chown -R $USERNAME $USERNAME
        pause;
        if OK continue else break
  Done

  Thanks again, Dean

  Hello, let's say I have a system where there are hundreds of users, with a
  system of NIS-mapped home dirs such as this:

  /filesystem/vol/users/user1
  /filesystem/vol/users/user2
  /filesystem/vol/users/user3
  ...
  /filesystem1/vol1/users/userX

  and each user is owner of their own home dir.

  Accidentally, I go through at the level of /filesystem/vol and
  I chmod -R user1 *   (I know, that was a mistake).

  Is there a way to run back through that and chown everyone back?

  _______________________________________________
  mdlug mailing list
  mdlug at mdlug.org
  http://mdlug.org/mailman/listinfo/mdlug



More information about the mdlug mailing list