Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Redirecting output from SFTP

 
Jörg Mohren
Advisor

Redirecting output from SFTP

Hello everybody

I am trying to redirect the output of a SFTP command under VMS 8.3. I already tried a pipe

pipe (define/user sys$command nl: ;-
sftp "-B" cmdfile user@host) -
> copy sys$pipe: sftp.out

but the command did not terminate. The cmdfile is stream_lf, and only contains two commands

ls *.xml
exit

Anybody got an idea where the problem might be?
6 REPLIES 6
labadie_1
Honored Contributor

Re: Redirecting output from SFTP

See this thread, and particularly what John Gillings says

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

Jörg Mohren
Advisor

Re: Redirecting output from SFTP

I used the idea of John Gillings, only omitting the setting of the status flag. The command did not work for me, neither with nor without setting the status flag. It was accepted, but did not terminate.
Interactively, I can perform the commands without any problem. Without the redirection, the ls output is correctly written to my terminal.
Jörg Mohren
Advisor

Re: Redirecting output from SFTP

Sorry, for clarification: The problem is not that the command does not work; it is that it does not terminate! If I cancel the script (Ctrl-C), the output is correctly written to the given output file.
Duncan Morris
Honored Contributor

Re: Redirecting output from SFTP

Have you tried using debug to see what is happening?

I have your command working fine for VMS to VMS in batch and interactive mode.

pipe (define/user sys$command nl: ;
sftp "-D 8" "-B" test.cmd morrisd@xxxxx) | copy sys$pipe: sftp.out

Is your remote server a non-VMS system? Perhaps the remote end is expecting some continuation command if the list exceeds a "screenful".

Try changing the ls *.xml to reference a single unique filename. If this works, then expand the list further until you hang. That would show the limit on the remote end.

Duncan
Hoff
Honored Contributor

Re: Redirecting output from SFTP

While you're working here (and in the presence of a support contract) remember to lob a request for COPY /SFTP support at HP.

In some configurations and applications, configuring a VPN engine (and firewall) "out front" -- OpenVMS operating as an embedded environment -- can be an appropriate solution.

Jörg Mohren
Advisor

Re: Redirecting output from SFTP

I tried to debug the command (output file attached), but I don't see the problem. The last in the output file is the output of the file (I tried to do a ls of just one file (login.com) as you recommended).
The remote system is an OpenVMS system as well.