Barry Lake wrote:
> 2) This will only create groups and users in the new YYY account that
> are needed to restore the files from the XXX account that are on your
> tape.
> 3) If you have special capabilities on any of the groups in account XXX,
> such as PM or PH, these capabilities won't be added to the
> corresponding groups in account YYY. In addition to your RESTORE,
> you should also :run BULDACCT.PUB.SYS;info="XXX" and then
> edit the resultant jobstream BULDJOB1 to change all occurences
> of XXX to YYY. Then run the job to duplicate completely the XXX
> environment in YYY.
for those times when -- for some reason -- you need to 'rebuild' an account and
you haven't done a buldacct (oh, *this* has never happened to me <blush>), i'll
offer the following....
first,
makegrp.cmd
parm acct="", node=""
listacct !acct
file fixfile;rec=-160,,f,ascii;temp;nocctl
purge fixfile,temp
run mpex.pub.vesoft;info="veaudit listgroup @.!acct,*fixfile"
listftemp fixfile,2
dscopy fixfile,ixg;!acct,!node
(i've made some assumptions here. in my environment, i have many mpe systems.
typically, i'll have an account on one box that i want to replicate on another
system -- hence the 'node' and dscopy stuff. the critical thing is your sending
the contents of listgroup out to a nocctl file....) in my help comments for
fixgroup, i remark about needing to edit the file to remove the headers. this
could easily be scripted.... (now if i could just find my round tuit :-)
second,
fixgroup.cmd
parm infile=""
if "!infile" = "?" or ups("!infile") = "HELP"
echo
echo FIXGROUP is designed to accept an input file that was
echo generated via MPEX's ListGroup command on ANOTHER MPE
echo system. The input file must be transferred onto the
echo target system. At some point the file must be editted
echo to remove headers and blank lines. The file's
echo record width is expected to be 160 bytes. The MAKEGRP
echo command will perform the above instructions.
echo
echo For every record in the input file, this script will
echo perform an ALTGROUP.
echo
return
endif
setvar _fx_SM pos('SM',hpusercapf) > 0
setvar _fx_AM pos('AM',hpusercapf) > 0
if (not _fx_SM) and (not _fx_am)
echo
echo ERROR: You must have 'SM' or 'AM' capability to
echo use this command
echo
deletevar _fx_@
return
endif
if not finfo("!infile","exists")
echo
echo ERROR: The file -- !infile -- does not exist
echo
deletevar _fx_@
return
endif
setvar fixgrp "!infile"
file fixgmsg;temp
if finfo("*fixgmsg","exists")
purge fixgmsg,temp
endif
file fixgmsg;rec=-160,,f,ascii;msg;temp
print !fixgrp > *fixgmsg
#--- group access permission array
setvar _fx_array "r,w,a,l,x,s"
while finfo("*fixgmsg","eof") > 0
input _fx_msgrec < *fixgmsg
setvar _fx_acct rtrim(str(_fx_msgrec,1,8))
setvar _fx_group rtrim(str(_fx_msgrec,10,8))
#--- extract uneditted access list
setvar _fx_access_list (str(_fx_msgrec,37,24))
setvar _fx_access "("
#--- loop counter
setvar _fx_i 0
#--- string position pointer
setvar _fx_offset 0
#--- counts number of access permissions found
setvar _fx_cntr 0
while setvar(_fx_i,_fx_i + 1) < 7
#--- extract an access permission
setvar _fx_x str(_fx_access_list,_fx_i+_fx_offset,3)
#--- find anything?
if _fx_x > " "
if _fx_i > 1 and _fx_cntr > 0
setvar _fx_access _fx_access+";"
endif
setvar _fx_cntr _fx_cntr + 1
#--- append onto access string
setvar _fx_access _fx_access+word(_fx_array,,_fx_i)+&
":"+ltrim(rtrim(_fx_x))
endif
#--- increment string pointer
setvar _fx_offset _fx_offset + 3
endwhile
setvar _fx_access _fx_access+")"
#--- setup capabilities list
setvar _fx_cap_list rtrim(ltrim(str(_fx_msgrec,63,60)))
setvar _fx_cap _fx_cap_list
while setvar(_fx_cap_list, repl(_fx_cap," "," ")) <> _fx_cap
setvar _fx_cap _fx_cap_list
endwhile
setvar _fx_cap repl(_fx_cap," ",",")
#--- build the altgroup command
echo altgroup !_fx_group.!_fx_acct;access=!_fx_access;cap=!_fx_cap
continue
altgroup !_fx_group.!_fx_acct;access=!_fx_access;cap=!_fx_cap
endwhile
reset fixgmsg
purge fixgmsg,temp
deletevar _fx_@
i won't claim the above is perfect but it does seem to work for me. maybe it
will help someone.... - d
--
Donna Garverick Sr. System Programmer
925-210-6631 [log in to unmask]
>>>MY opinions, not Longs Drug Stores'<<<
|