Operating System - OpenVMS
1753469 Members
5265 Online
108794 Solutions
New Discussion юеВ

Re: SFTP batch job vs interactive

 
James T Horn
Frequent Advisor

SFTP batch job vs interactive

OpenVMS Alpha 8.3
TCPIP V5.6

When trying to do a sftp "-B" file.nam user@domain.com

from an interactive session, this command works. When trying to do it via a batch jobs, get the following error:
Failed to set terminal mode to PASTHRU in sftp.d

and it does not return any information.
2 REPLIES 2
Hoff
Honored Contributor

Re: SFTP batch job vs interactive

There's an existing discussion of using sftp from batch:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=985928

Also see the sftp batch stuff in the http://h71000.www7.hp.com/doc/83final/ba548_90007/ba548_90007.pdf ssh manual and in the release notes.

A variant solution (and which you're aware of) involves pseudo-terminals.

http://groups.google.com/group/comp.os.vms/browse_thread/thread/935cb20e7ca233c1/e81df2ace8ab8835

And in various implementations of the sftp client on various platforms, switching to batch mode explicitly disallows prompting for the password; you have to switch away from passwords to use this.
John Gillings
Honored Contributor

Re: SFTP batch job vs interactive

James,

SSH (and I presume SFTP) make assumptions about their environment which aren't always true. Try preceeding your command with

$ DEFINE/USER SYS$COMMAND NL:

I find this is necessary when executing SSH commands from a command procedure. I'm guessing it's the same for SFTP.
A crucible of informative mistakes