HP3000-L Archives

November 1999, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Cary A Marshall <[log in to unmask]>
Reply To:
Cary A Marshall <[log in to unmask]>
Date:
Mon, 15 Nov 1999 12:13:16 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (96 lines)
I'm writing a script to  transfer spoolfile from our HP3K to directories on
our NT server.  The script will capture spoolfiles depending on their device
IDs, then FTP them to the NT box.  Since spoolfiles can be created anytime
during the day, this script will check periodically for the existence of
spoolfile.

I've come up with a script that works, but it's not as clean as I would
like.  It first finds a spoolfile, opens a ftp connection, moves the file to
the NT box, then closes the ftp connection.  It does this for each
spoolfile.  It looks something like this, with the help of MPEX:

!file ftpcomm;msg
!file filex;rec=-1008,,v,ascii;disc=50000
!while (some condition)
!repeat
(find spoolfile )
!cat.hpbin.sys O1234.out.hpspool > *filex
!echo exitonerror >>*ftpcomm
!echo open !inode >>*ftpcomm
!echo user !iuser >>*ftpcomm
!echo user !ipass >>*ftpcomm
!echo put filex newname >>*ftpcomm
!echo quit >>*ftpcomm
!run ftp.arpa.sys;stdin=*ftpcomm
!for (spool files with device="netprint")
!endwhile


The script pauses for xx seconds after the last spoolfile is FTPed, then the
routine repeats.

What I'd like to do is find a spoolfile, open the FTP connection, move the
file, then continue searching for more spoolfiles to move while the FTP
connection is still open.  After the  last spoolfile is found and moved, the
FTP connection would close.

Because of a bug(?) with mpe 5.5, (we're on pp7) FTPing a spoolfile doesn't
work properly.  Instead, I'm using the suggestion of Tony Gil to use
cat.hpbin to reformat the spoolfile; cat.hpbin.sys o1234.out.hpspool >
FILEX. Then I FTP FILEX, creating a unique name for each spoolfile on the NT
box.  And this is where I'm having the problem; I don't know how to work
with the ftpcomm message file so that it will allow me to do puts with
different spoolfiles.  I tried something like this....

!file ftpcomm;msg
!file filex;rec=-1008,,v,ascii;disc=50000
!while (some condition)
!repeat
(find spoolfile)
!cat.hpbin.sys O1234.out.hpspool > *filex
!echo exitonerror >>*ftpcomm
!echo open !inode >>*ftpcomm
!echo user !iuser >>*ftpcomm
!echo user !ipass >>*ftpcomm
!echo put filex newname >>*ftpcomm

(find another spoolfile with dev=netprint)
!cat.hpbin.sys O2345.out.hpspool > *filex
!echo put filex newname1 >>*ftpcomm
(continue until no more spoolfiles)

!echo quit >>*ftpcomm
!run ftp.arpa.sys;stdin=*ftpcomm

!for (spool files with device="netprint")
!endwhile

... but it kept writing the same spoolfile, albeit with different network
names. I thought about creating new file names (filex, filex1..) for each
put, but I don't know how many I would need, and it seems to be a bit messy.
I'm so close, yet....  Any ideas?

Thanks very much.

Cary Marshall
Systems Analyst
GKN Aerospace, Chem-tronics Inc
1150 W. Bradley Ave
El Cajon, CA 92020  USA
e-mail: [log in to unmask]


[Disclaimer]This e-mail is strictly confidential and intended solely for the
addressee. It may contain information which is covered by legal,
professional, or other privilege. If you are not the intended addressee you
must not use, disclose, or copy this transmission. This E-mail is not
intended to impose nor shall it be construed as imposing any legally binding
obligation upon GKN Aerospace Chem-tronics Inc. and/or any of its
subsidiaries or associated companies. Neither GKN Aerospace Chem-tronics
Inc. nor any of its subsidiaries or associated companies gives any
representation or warranty as to the accuracy or completeness of the
contents of this E-mail. GKN Aerospace Chem-tronics Inc. shall not be held
liable to any person resulting from the use of any information contained in
this E-mail and shall not be liable to any person who acts or omits to do
anything in reliance upon it.

ATOM RSS1 RSS2