[Klug-general] A cli for bulk owner changes?
Mike Evans
mike at tandem.f9.co.uk
Sat Oct 22 09:50:55 UTC 2011
On 22/10/11 10:05, Michael E. Rentell wrote:
> Excellent. Very very many thanks for that Mike.
You're welcome, and kudos to MacGyveR for remembering about the : which
allows you to combine the two commands.
Now that the disaster has passed may I suggest that you look a little
more closely at the way you back up and restore? It should be possible
to preserve users and groups during that process and most commands have
flags/switches/options designed for doing this. This is often not the
default behaviour (which always seemed bizarre to me) so you have to
specify to keep permissions, owner and group, often with a -a or -A option.
If you had a lot of users it becomes important as restoring appropriate
permissions would be tedious. In addition, it is a rather sweeping
assumption that all the files under a user's home directory do in fact
belong to the user's login group. (Generally true but users may, for a
variety of reasons, choose to change the default group of a file or
directory to give other users and programs more or less access to it.)
Mike
More information about the Kent
mailing list