> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Petersen, Jim
> Sent: Thursday, August 17, 2006 12:22 PM
> To: [email protected]
> Subject: Scripts for HFS Files
> 
> I want to create an OMVS Script which will allow me to populate the
> "OMVS.ROOT" file shipped from the factory with my symbolic links and
> directories for mount points.   Can anyone help me with a template?
> ___________________________________________ 
> Jim Petersen

Paul's suggestion is good, but doesn't help if you don't already have
the information. The following OMVS REXX program can be used to create
the necessary "mkdir" and "chown" commands to mirror your current
mounts. Note that this only looks at things that are mounted at the time
the REXX program is run. So if you have mountpoints which are transient,
it may not pick them up.

Put the code in a OMVS (UNIX) file (mkmount.rexx in my example),do a
chmod 755 to make that file executable, then run it. "./mkmount.rexx
>mkmount.output". You can then OEDIT this file, and use cut-n-paste to
put it in some JCL file somewhere for later. Note that I used "/newroot"
where the new root will be mounted so that you can run the script. This
HFS need not be mounted when the script runs. In fact, it likely should
not be.

mkmount.rexx:

/* rexx */
call bpxwunix "df",,"df."
madedirs=""
do i = 1 to df.0
   if "/" <> left(df.i,1) then iterate
   parse var df.i mountpoint .
   path ="/newroot"
   statpath="/"
   mountpoint = substr(mountpoint,2)
   do forever
      parse var mountpoint b4 '/' mountpoint
      if b4 = "" then leave
      path = path"/"b4
      statpath=statpath"/"b4
      if pos(path,madedirs) <> 0 then iterate
      madedirs = madedirs path
      address syscall "stat (statpath) pathinfo."
      say "mkdir "path pathinfo.ST_MODE
      say "chown "pathinfo.ST_UID"."pathinfo.ST_GID path
      if mountpoint = "" then leave
   end
end

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

This message (including any attachments) contains confidential
information intended for a specific individual and purpose, and its
content is protected by law.  If you are not the intended recipient, you
should delete this message and are hereby notified that any disclosure,
copying, or distribution of this transmission, or taking any action
based on it, is strictly prohibited. 
 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to