<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: changing uid on many system in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176631#M162144</link>
    <description>Geoff and Sridhar&lt;BR /&gt;You are saying that I should use find command inside the script and use that recursively correct?&lt;BR /&gt;&lt;BR /&gt;Sachin</description>
    <pubDate>Wed, 28 Jan 2004 14:11:04 GMT</pubDate>
    <dc:creator>Sachin Patel</dc:creator>
    <dc:date>2004-01-28T14:11:04Z</dc:date>
    <item>
      <title>changing uid on many system</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176628#M162141</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;We have few hunders users and tens of systems.&lt;BR /&gt;We are using nis for logging. This was setup long time ago so uid was started below 100 and uid was started below 50. &lt;BR /&gt;We would like to change uid and gid of users. whenever I change something on nis and push the map out it is going to be problem as all the files belong to that new uid is not getting updated automatically. &lt;BR /&gt;&lt;BR /&gt;What is the best way to achive this?&lt;BR /&gt;&lt;BR /&gt;I have write script but that hangs and is not working proparly with nfs file system ( I actully do not want to chage anything on nfs though). &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Sachin&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jan 2004 12:47:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176628#M162141</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2004-01-28T12:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: changing uid on many system</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176629#M162142</link>
      <description>Hmnnn...why not just run a find command:&lt;BR /&gt;&lt;BR /&gt;find $4 -user $1 | xargs chown $2:$3 {}&lt;BR /&gt;&lt;BR /&gt;$4 is filesystem&lt;BR /&gt;$1 is old uid&lt;BR /&gt;$2 is new uid (or just the user id)&lt;BR /&gt;$3 is gid (or just groupname)&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Wed, 28 Jan 2004 13:42:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176629#M162142</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-01-28T13:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: changing uid on many system</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176630#M162143</link>
      <description>Sachin,&lt;BR /&gt;&lt;BR /&gt;You have a huge task in front of you. Changing uids can break the things particularly on NFS as all of a sudden you will find errors like 'permission denied' etc.,&lt;BR /&gt;&lt;BR /&gt;One way is run 'find' command only once and capture enough information and then use that information to change the ownerships. ownerships.&lt;BR /&gt;&lt;BR /&gt;find / |xargs ll -d &amp;gt; /somewhere/filelist.&lt;BR /&gt;&lt;BR /&gt;If the argument list is too long, you can seperate it by filesystem wise. Then you can find the files owned by a particular user and change ownerships on only those files. I got couple of hiccups but got successful before.&lt;BR /&gt;&lt;BR /&gt;Alternatively, using the common method, run find for every user.&lt;BR /&gt;&lt;BR /&gt;You can use '-local' option in find to avoid changing permissions on the nfs filesystems. However, it will not stop traversing through NFS directories. The otherway is to selectively use -fsonly for both hfs and vxfs. But again there are limitations to it. Look at the man page.&lt;BR /&gt;&lt;BR /&gt;find / -local -user $uid |xargs chown user:group&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Wed, 28 Jan 2004 13:59:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176630#M162143</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-01-28T13:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: changing uid on many system</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176631#M162144</link>
      <description>Geoff and Sridhar&lt;BR /&gt;You are saying that I should use find command inside the script and use that recursively correct?&lt;BR /&gt;&lt;BR /&gt;Sachin</description>
      <pubDate>Wed, 28 Jan 2004 14:11:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176631#M162144</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2004-01-28T14:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: changing uid on many system</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176632#M162145</link>
      <description>I would test it with 1 user - the find that is....I'm not a perl wiz - there may be something amis in your script - that's why I suggested the "simple" way....&lt;BR /&gt;&lt;BR /&gt;I would run it for each user....&lt;BR /&gt;&lt;BR /&gt;I just used the $4, etc in case you want to script it.&lt;BR /&gt;&lt;BR /&gt;Srindhar brings up a good point - you may want to produce a list instead - that way, is you have to go back - you can see what they were - or like he says, use that list to run the chown against:&lt;BR /&gt;&lt;BR /&gt;for i in `cat filelist`&lt;BR /&gt;do&lt;BR /&gt;chown userid:group $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Wed, 28 Jan 2004 14:23:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176632#M162145</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-01-28T14:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: changing uid on many system</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176633#M162146</link>
      <description>The ideal way to do this would be to do a find for each system and produce a list but not just any list. You want a list that is sorted in uid,gid order. Then for every uid:gid tuple you can spawn a single chown command using xargs. You definitely want to avoid multiple passes with find.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jan 2004 14:35:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176633#M162146</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-01-28T14:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: changing uid on many system</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176634#M162147</link>
      <description>Good idea but not fisable in my environment&lt;BR /&gt;&lt;BR /&gt;We have 100+ system and 700Tb+ space you can imagine what happens if try to do it by hand.&lt;BR /&gt;&lt;BR /&gt;I have run this script on linux and hps works fine in most cases but gets hang or gets stuck in loop sometime. So far I am the test user. &lt;BR /&gt;&lt;BR /&gt;Any other idea?</description>
      <pubDate>Wed, 28 Jan 2004 14:37:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176634#M162147</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2004-01-28T14:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: changing uid on many system</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176635#M162148</link>
      <description>Clay, Geoff and Sridhar&lt;BR /&gt;&lt;BR /&gt;My idea was to change one user at a time.&lt;BR /&gt;run script overnight on all the system by passing old uid,new uid so script will find anything that is old uid and change to new. &lt;BR /&gt;&lt;BR /&gt;Then pick another user again and do same processess. I will not be able to change all at same time.&lt;BR /&gt;&lt;BR /&gt;But if I finds anyother idea better thenthis I am ready to implement it.&lt;BR /&gt;&lt;BR /&gt;Sachin</description>
      <pubDate>Wed, 28 Jan 2004 14:45:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176635#M162148</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2004-01-28T14:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: changing uid on many system</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176636#M162149</link>
      <description>Multiple passes is the non-optimal (dumb) way to do that. The idea is to make one find pass and build a list. Sort it in gid, uid order. Next read in each line using awk/Perl/ or even shell and make your uid and gid substitions to greate a new list that has gid, uid, filename as fields. You then make a final pass that generates a series of chown commands. This will run tens of times faster than your method. With only a little extra work you could remsh the whole thing and execute perhaps 10 of these at a time in backgroup. You would then issue a wait which would wait until all 10 of these finished and spawn a new bunch.&lt;BR /&gt;&lt;BR /&gt;You should think of this not as a uid/gid change process but a learning process.&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jan 2004 16:13:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176636#M162149</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-01-28T16:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: changing uid on many system</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176637#M162150</link>
      <description>Clay looks like you are right. I should look this task differently. &lt;BR /&gt;I now have another eye it just make me realize that if I change one of the programmer's uid and If I can't change his files with new uid all the programm will be broken. I have to have list ready and as soon as I change uid on nis I will have to change listed files.&lt;BR /&gt;&lt;BR /&gt;I fixed my script now so it is working on sun, hp and linux but not fast enough. It is taking 10 to 15 minutes per system. But If I have list of files ready It can be done within a minute.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Sachin</description>
      <pubDate>Wed, 28 Jan 2004 17:45:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176637#M162150</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2004-01-28T17:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: changing uid on many system</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176638#M162151</link>
      <description>Thanks guys,&lt;BR /&gt;Now I have two script &lt;BR /&gt;1. goes to datacenter runs find command on local disk and finds files belong to particular user and generat a file.&lt;BR /&gt;Takes around 10 hours.&lt;BR /&gt;&lt;BR /&gt;2. runs chown on that listed file only.&lt;BR /&gt;Takes less then half hour.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Sachin</description>
      <pubDate>Thu, 29 Jan 2004 13:29:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176638#M162151</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2004-01-29T13:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: changing uid on many system</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176639#M162152</link>
      <description>Hi Sachin,&lt;BR /&gt;&lt;BR /&gt;A find command will touch everyfile anyway. Then why wouldn't you run it to gather the information for all the files?.&lt;BR /&gt;&lt;BR /&gt;If you don't want it, then atleast you can club multiple users in one shot.&lt;BR /&gt;&lt;BR /&gt;find / -local \( -user user1 -o -user user2 -o -user user3 \) |xargs ll -d &amp;gt;&amp;gt; /somewhere/list&lt;BR /&gt;&lt;BR /&gt;Now list has files of user1, user2 and user3. Now you can seperate each user into a different list and have the ownerships changed. You can automate it too.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jan 2004 13:36:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176639#M162152</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-01-29T13:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: changing uid on many system</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176640#M162153</link>
      <description>sridhar,&lt;BR /&gt;I have put that provision in place so I can collect info upto three user.&lt;BR /&gt;But most probable it will not work because of space issue. &lt;BR /&gt;I have terrabyte of space with each system and only small /tmp file where I am collecting information.&lt;BR /&gt;I can't use other file system as they all low in space and has no uniq nameing. &lt;BR /&gt;Also I have to run one script for hp-sun-linux too.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help and ideas for pointing me in right direction.&lt;BR /&gt;&lt;BR /&gt;Sachin</description>
      <pubDate>Thu, 29 Jan 2004 13:57:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-uid-on-many-system/m-p/3176640#M162153</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2004-01-29T13:57:06Z</dc:date>
    </item>
  </channel>
</rss>

