On 08/19/2015 09:07 AM, David Sommerseth wrote:
On 19/08/15 14:51, Chris Schanzle wrote:
[...snip...]
>I wouldn't imagine migrating to the new scheme would be*that* difficult
>once you nail down the user, old uid, new uid, change their passwd uid,
>then run something like this on all your systems: find PATHS -user
>$oldID -exec chown -h $newID {} +
I've done this a few times. Basically my routine was:
---------------------------------------------------------------
for d in /home /var /tmp; # See note below
do
find $d -uid ${OLD_UID} -exec chown -ch ${NEW_UID} {} \;
find $d -gid ${OLD_GID} -exec chgrp -ch ${NEW_GID} {} \;
done;
That's fine, but there's no need for the loop -- just put all the paths right after
"find". And by using the + operator, you don't fork chown/chgrp for every file.
If you're changing GID's too, separating out the GID search/reset is a good
idea to ensure you get all the GID's (not just those matching a UID and using
chown -h ${NEW_UID}:${NEW_GID}, which could result in unexpected GID changes.