Operating System - OpenVMS
1752800 Members
5696 Online
108789 Solutions
New Discussion юеВ

Re: Using SFTP in Batch Mode on OpenVMS

 
SOLVED
Go to solution
Joseph J. Affrunti
New Member

Using SFTP in Batch Mode on OpenVMS

Hi,

I'm trying to get an SFTP command to work in a VMS batch job. The command format is as follows:

$ SFTP -v "-B" abc@xyz

where "abc" is a valid user name and "xyz" is a valid node name.

Public key authentication is set on both nodes. The client node is an Itanium running OpenVMS 8.2. The server node is a Linux machine. This command works correctly when entered at an interactive DCL level, but fails when run as a VMS batch job (i.e., job submitted to a VMS batch queue.) The error being returned is:

Error: Could not read the batchfile.

The protection on the input file is
(S:RWED,O:RWED,G:RE,W:RE)

Any help would be appreciated. Thank you.
7 REPLIES 7
John Travell
Valued Contributor

Re: Using SFTP in Batch Mode on OpenVMS

Does the information in threadId 985928 help ?
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=985928

JT:
Steven Schweda
Honored Contributor

Re: Using SFTP in Batch Mode on OpenVMS

With all the disguising of the command
details, it's hard to tell if the
"" is valid from the default
directory for the batch job, which might
easily be different from your interactive
default directory. If it's some relative
spec and the default directories are
different, the explanation could be pretty
simple.

What, exactly, are "" and the two
default device-directory specs?
Joseph J. Affrunti
New Member

Re: Using SFTP in Batch Mode on OpenVMS

Thanks for your reply.

I had seen this entry before. There doesn't seem to be any problem with authentication. The -v swith puts out verbose information and we can see from it that the client is successfully connecting to the server. The problem seems to be that when running as a batch job, the client (I think) cannot read the input file. Unfortunately, it doesn't put out any indication as to why it can't read the file.

Joseph J. Affrunti
New Member

Re: Using SFTP in Batch Mode on OpenVMS

The actual command is:

$ SFTP -v "-B" SYS$SYSROOT:[SYSMGR]Filex.txt user1@lnx32
Steven Schweda
Honored Contributor
Solution

Re: Using SFTP in Batch Mode on OpenVMS

This works interactively for you?

Around here, I see only "Error: Could not
read the batchfile."

alp $ tcpip show version

HP TCP/IP Services for OpenVMS Alpha Version V5.4 - ECO 6
on a COMPAQ Professional Workstation XP1000 running OpenVMS V7.3-2

alp $ ssh "-V"
alp$dka0:[sys0.syscommon.][sysexe]tcpip$ssh_ssh2.exe: SSH Secure Shell OpenVMS (
V5.5) 3.2.0 on COMPAQ Professional Workstation - VMS V7.3-2


On the other hand, I get some success if I
specify the batch file using a UNIX-like
syntax, "/SYS$SYSROOT/SYSMGR/FILEX.TXT" (or
"/SYS$MANAGER/FILEX.TXT").

However, if that file is not "Record format:
Stream_LF", then SFTP appears to try to
convert it (in place, more or less), and if
run by some peon without write permission to
that directory (or file?), it fails with
something like:

Warning: Converting file /sys$manager/filex.txt to Stream_LF.
openvms_specific/OPENVMS_SPECIFIC.C:1911: Error calling CONV$CONVERT for /sys$manager/filex.txt.
Status = %CONV-F-OPENOUT, error opening !AS as output

So, my advice is, "Think UNIX.", which
means: Start with a Stream_LF batch file, and
specify its location with a UNIX-like
syntax. For that matter, if you're
_sending_ any files, thay'd better look
UNIXy, too (Stream_LF or, perhaps,
fixed-512), if you expect them to look like
anything at the other end.
Joseph J. Affrunti
New Member

Re: Using SFTP in Batch Mode on OpenVMS

Bingo!!!

The file was in Stream_LF format but it was the UNIX syntax that did the trick. Thank you very much, Steven. And also you, John, for your reply.
Joseph J. Affrunti
New Member

Re: Using SFTP in Batch Mode on OpenVMS

The solution is to use UNIX syntax. Thanks to all who replied.