HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Automated FTP script

 

Automated FTP script

Hi to all, I'm new to OpenVMS and I was assigned to administer our OpenVMS boxes. One of my task is to extract all system log files weekly and I need a script to automate transfer of the log files via FTP.

Help is badly needed on this case.

thanks in advance.
7 REPLIES
Gary Sachs
Advisor

Re: Automated FTP script

You might considering the COPY/FTP command, see HELP. I find that DECnet copies are probably the easiest, especially with proxies set up. We have found thet setting up FTP scripts require passwords be hard coded, unless you set up an account without a password( not necessarily a good idea) or you could use ANONYMOUS FTP.

Re: Automated FTP script

hi gary, thanks for the help but it is okay for me to use ftp scripts. Can you provide me a sample of the FTP script so that i can experiment with it? I'm currently using same setup with our UNIX boxes and the FTP server that I dumped files to has security setup for upload only.

again, thanks.
Paul Nunez
Respected Contributor

Re: Automated FTP script

Hi Rodel,

FTP is FTP, no? Try $ HELP FTP. You'll see there's a /USERNAME, /PASSWORD, and a /INPUT qualfier. So you write your FTP script and supply that name with the /INPUT= qualifier.

Or are you more interested in learning which specific log files should be examined? There is no standard, single location for the multitude of logs, but many of the system log files are in the SYS$MANAGER: directories.
One such file would be SYS$MANAGER:OPERATOR.LOG.

Often, applications have their own log files.

Or use $ DIR SYS$SYSDEVICE:[000000...]*.LOG;0 to get a list of all log files on the system disk.

HTH,

Paul Nunez
HP Services

Re: Automated FTP script

Hi Sir Paul, I tried what you suggested but my machine says that it has no documentation for FTP. Maybe you can show me a sample script to extract a particular system log say SYS$ERRORLOG:ERRLOG.SYS and ftp it to a particular FTP server.

again thank you very much.
Paul Nunez
Respected Contributor

Re: Automated FTP script

Hi,

Well, if $ HELP FTP doesn't work perhaps:

1. You don't even have TCP/IP installed on the VAX or

2. You're running a 3rd party TCP/IP stack on the VAX (i.e, Multinet)

Does just doing:

$ FTP

get you into the command line interface?

If it does, try HELP from there :).

But basically you could put these commands in a procedure and supply them as input.

For example, if you're _pushing_ the files to the remote system:

bin
put sys$error:syserrorlog.sys
ascii
put sys$manager:operator.log

If you're using the later versions of TCP/IP Services for OpenVMS ($ UCX SHOW VER), you could then do:

$ FTP /USERNAME= /PASSWORD=/INPUT=<scriptfile>

If $ UCX SHOW VERSION doesn't work, try $ MULTI SHOW/VER
Martin P.J. Zinser
Honored Contributor

Re: Automated FTP script

>>If<< you only need to get files you might want
to check-out ftp_mirror.com available via

http://vms.process.com/fileserv-software.html

That assumes the target (where you transfer the data to) is a VMS system...
Art Wiens
Respected Contributor

Re: Automated FTP script

Something like this might give you a few ideas:

$!***************************
$! FTP Files
$ REMOTE_DIR_SYMBOL = " remote\directory "
$!
$ SET DEFAULT SYS$ERRORLOG:
$!
$! Create temporary command procedure to FTP files to server
$!
$ DELETEE SYS$LOGIN:FTP_FILE.COM;*
$!
$! (open logical_file_name real_file_name)
$ OPEN /WRITE FTP_COM_FILE SYS$LOGIN:FTP_FILE.COM
$!
$ WRITE FTP_COM_FILE "$ FTP"
$ WRITE FTP_COM_FILE "OPEN 10.1.2.3 username password"
$ WRITE FTP_COM_FILE "cd ", REMOTE_DIR_SYMBOL
$ WRITE FTP_COM_FILE "pwd"
$ WRITE FTP_COM_FILE "bin"
$ WRITE FTP_COM_FILE "put ERRORLOG.SYS"
$ WRITE FTP_COM_FILE "dir"
$ WRITE FTP_COM_FILE "close"
$ WRITE FTP_COM_FILE "quit"
$ WRITE FTP_COM_FILE "$ EXIT"
$ CLOSE FTP_COM_FILE
$!
$! Execute FTP command procedure
$!
$ @SYS$LOGIN:FTP_FILE.COM
$!***************************

HTH,
Art