chbog Code
A utility to implement bulk uid:gid changes within a filesystem.
Brought to you by:
chbogm
chbog - CHange Bulk Owner Group chbog is a utlity to implement bulk changes in a filesystem. Suppose your organization 'acquires' another organization. Naturally there occur collisions in the uid:gid space of the two filesystems. One might consider it convenient to have a utility which would read in a mapping of the changes required to assimilate this 'acquired organization' into the collective. Thus 'chbog'. Whatever the reason you may have to make changes to a filesystem; be it 'acquisition', 'merger' or some other 'management inflicted' reason; it happens, occasionally, that such changes are rather extensive. The traditional technique of shell and find, perl or python to implement such changes are more than adequate for (relatively) small scale changes. However, hundreds of changes can be, shall we say, daunting. No doubt. Consider the following two organizations: Organization F: fred 1000:100 wilma 1001:100 pebbles 1002:100 barney 1003:100 betty 1004:100 bambam 1005:100 Organization J: george 1000:500 jane 1001:501 judy 1002:502 elroy 1003:503 The task is to assimilate organization J into organization F. Appropriate mapping rules to migrate from organization J's uid:gid space into organization F's uid:gid space must be prepared. Configuration file 'chbog.conf' contents: id_map = 1000 : -1 : 1006 : 100 # george id_map = 1001 : -1 : 1007 : 100 # jane id_map = 1002 : -1 : 1008 : 100 # judy id_map = 1003 : -1 : 1009 : 100 # elroy You make the usual announcements in preparation for the changes. You identify the administrative machine within organization J, and verify that you are able to change ownership of files on the filer. This is important, because you could fall victim to some unusual mount options. During the scheduled maintenance window you log into the administrative machine within organization J and execute the following: # chbog -f -c chbog.conf -p /home Granted, this is a small example, no doubt. But it illustrates the idea.