- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: FTP command file issue
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2009 10:16 AM
тАО07-13-2009 10:16 AM
Re: FTP command file issue
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2009 11:32 AM
тАО07-13-2009 11:32 AM
Re: FTP command file issue
One method that I haven't seen mentioned yet in this thread, is the use of ftp host /input=vms_file_with_ftp_commands The input file can have the remote username and password as the first two lines of the input file, followed by ftp commands to execute (including quit), alternatively, the username and password can be passed on the DCL FTP command line with /username and /password. In this case the /input file should not have the username and password. In other words, if the username and password are not specified using the command line /username and /password, then FTP will be expecting the username and password as the first two lines of input.
The integration of FTP in DCL commands is nowhere as seemless as the integration of DECnet into DCL. For example there is no $ RENAME/FTP DCL command. Also, some things just won't work when initiating a tcp session for each command, for example something like "quote site umask" commands, which only remain in effect only for the duration of the ftp session.
Example code to copy from 'vms_name' to 'unix_name' while making the 'unix_name' appear to be 'atomically' created. This transfers to a temporary file nmae 'xfr_name' on the remote side, then uses ftp rename to rename the file on the remote side. Note: There is no VMS command RENAME/FTP
$ pid = f$getjpi("","PID")
$ temp = "sys$scratch:ftpinput.''pid';"
$ create 'temp'
$ temp = f$search(temp)
$ close/nolog ftpcmd
$ open/append ftpcmd 'temp'
$ write ftpcmd "''ftp_user'"
$ write ftpcmd "''ftp_usrp'"
$ write ftpcmd "ascii"
$ write ftpcmd "quote site umask 111" ! change default protection for created files to -rw-rw-rw-
$ write ftpcmd "put ''vms_name' ''xfr_name'"
$ write ftpcmd "rename ''xfr_name' ''unix_name'"
$ write ftpcmd "quit"
$ close/nolog ftpcmd
$ if .not. debug
$ then
$ define/user sys$output nla0:
$ else
$ type* 'temp'
$ endif
$ set noon ! so we can manually process ftp status
$ ftp 'ftp_srv' /input='temp'
$ ftp_copy_code := '$status'/'$severity'
$ ftp_copy_status = f$element(0,"/",ftp_copy_code)
$ ftp_copy_severity = f$element(1,"/",ftp_copy_code)
$ last_status = ftp_copy_status
$ if ftp_copy_severity .eq. 1
$ then
$ ! put code here to be executed if file was successfully copied
$ 'nodeb' delete* 'temp'
$ else
$ ! put code here to be executed if file copy failed
$ endif
The biggest disadvantage of this method is that you have very limited error handling, about all you know it that the whole sequence succeeded, or that some part of it failed, but which part is not easy to determine.
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2009 12:16 AM
тАО07-14-2009 12:16 AM
Re: FTP command file issue
The copy/ftp command worked nicely, but didn't put the file onto the UNIX box in uppercase, which the FTP command minus the $s did, so I'm going with that for the time being.
Thanks again everyone.
dave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2009 01:27 AM
тАО07-14-2009 01:27 AM
Re: FTP command file issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2009 04:43 AM
тАО07-14-2009 04:43 AM
Re: FTP command file issue
I'll presume you're on OpenVMS I64 V8.2-1 or (more likely) OpenVMS I64 V8.3-1H1 here (AFAIK, there's no V8.3-1), and these versions also mean you can also alter your DCL-level command parsing settings as required. Specifically, this is the SET PROCESS /PARSE=EXTENDED command. This mechanism preserves file case (case-preserving, case-blind) and how application-level switches (foreign commands) and related are processed.
The extended parsing mechanism is often associated with making full use of ODS-5 disk structures, but is a separate process-level selection knob.
- « Previous
-
- 1
- 2
- Next »