- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- SFTP in batch mode
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
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
тАО05-10-2011 03:34 AM
тАО05-10-2011 03:34 AM
SFTP in batch mode
$ ty ls.txt
pwd
ls
quit
$ set ver
$ define/user sys$command nl:
$ sftp "-B" ls.txt user@host
$ set nover
The same occurs when I submit it as a batch job.
tcpip sh version
HP TCP/IP Services for OpenVMS Alpha Version V5.5 - ECO 1
on an AlphaStation DS15 running OpenVMS V8.2
Any ideas what I am doing wrong? How can I see the output.
- Tags:
- sftp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2011 04:01 AM - last edited on тАО08-02-2011 08:13 AM by Kevin_Paul
тАО05-10-2011 04:01 AM - last edited on тАО08-02-2011 08:13 AM by Kevin_Paul
Re: SFTP in batch mode
Hi Mark,
ssh/sftp/scp in BATCH mode REQUIRES "passwordless" authentication such as publickey or hostbased.
You cannot supply a password in batch mode.
Use the itrc search facility to see several threads on using sftp in batch mode on OpenVMS.
http://h30499.www3.hp.com/t5/Networking/Using-SFTP-in-a-batch-job/m-p/4777756#M9817
There are quite a lot of threads with examples of capturing output from sftp and/or ssh batch procedures.
http://h30499.www3.hp.com/t5/Languages-and-Scripting/SSH-capturing-output-within-a-PIPE-stream/m-p/5267853#M12767
Duncan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2011 04:05 AM
тАО05-10-2011 04:05 AM
Re: SFTP in batch mode
Anyway if I was using passwords, I would have expected to see an error message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2011 04:50 AM
тАО05-10-2011 04:50 AM
Re: SFTP in batch mode
Is that the latest ECO? (I'd look for
myself, if I still had any useful patch
access.) If not, then that'd be my first
step.
> [...] How can I see the output.
Uh, stop sending it to NL:? I'd say that the
time to start thinking about using NL: for
anything is _after_ you get something to
work.
A Forum search for keywords like, say:
sftp batch
should find some examples where this worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2011 04:58 AM
тАО05-10-2011 04:58 AM
Re: SFTP in batch mode
define/user sys$command nl:
I added that line because a search here for sftp batch suggested that that was a good thing to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2011 05:12 AM - last edited on тАО08-08-2011 02:56 PM by Kevin_Paul
тАО05-10-2011 05:12 AM - last edited on тАО08-08-2011 02:56 PM by Kevin_Paul
Re: SFTP in batch mode
> I added that line because a search here for
> sftp batch suggested that that was a good
> thing to do.
If only my psychic powers were stronger, then
I might be able to see your search results.
_Then_ I might be able to judge the value of
that suggestion. (Or even know that it had
no effect.)
_My_ search results included this:
http://h30499.www3.hp.com/t5/Networking/Using-SFTP-in-a-batch-job/m-p/4777756#M9817
which seems to offer a pretty similar working
example.
> Is that the latest ECO?
Still wondering. TCPIP is seldom bug-free,
but any version that old with only one ECO
seems to me to be a poor risk.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2011 08:22 AM
тАО05-10-2011 08:22 AM
Re: SFTP in batch mode
even with a current version of TCPIP services
$tcpip show ver
HP TCP/IP Services for OpenVMS Alpha Version V5.7 - ECO 2
on an AlphaServer 400 4/166 running OpenVMS V8.4
the procedure never terminates, if you redefine sys$command when run in batch or interactive mode. The issuing process returns the file list, but never processes the command following the ls, remaining in a loop.
Drop the "define", and the job runs correctly. See the attached output from 2 runs.
Duncan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2011 11:48 PM - last edited on тАО08-08-2011 02:57 PM by Kevin_Paul
тАО05-10-2011 11:48 PM - last edited on тАО08-08-2011 02:57 PM by Kevin_Paul
Re: SFTP in batch mode
Duncan,
Strange. My script does not hang. With or without the define no output is produced.
I introduced the define as a result of the following thread
http://h30499.www3.hp.com/t5/General/Redirecting-output-from-sftp/m-p/5264499#M27630
Here Joerg Mohren also sees looping. I have now followed the solution of RBrown, but this resulted in an empty output file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2011 05:40 AM
тАО05-11-2011 05:40 AM
Re: SFTP in batch mode
Here is a working example of what you are trying to do performed on my system. You'll just need to modify a few things to match your environment.
$! Main procedure submitted to batch
$!
$ type sftp_hprc.com
$ set verify
$ define/nolog sys$login SYS$SYSROOT:[W_MCGAW]
$ set def SYS$SYSDEVICE:[W_MCGAW]
$ create ls.txt
$ deck
pwd
ls
$ eod
$ sftp "-Bls.txt" W_MCGAW@HOSER
Command to submit:
$ submit/noprint/log=SYS$SYSDEVICE:[W_MCGAW]SFTP_HPRC.LOG/notify SFTP_HPRC.COM
Job SFTP_HPRC (queue SYS$BATCH, entry 99) started on SYS$BATCH
Job SFTP_HPRC (queue SYS$BATCH, entry 99) completed
The log file that was created:
$ TYPE SFTP_HPRC.LOG
$ Set NoOn
$ VERIFY = F$VERIFY(F$TRNLNM("SYLOGIN_VERIFY"))
%SET-W-NOTSET, error modifying DKC0:
-SET-E-INVDEV, device is invalid for requested operation
11-MAY-2011 07:35:22
$ define/nolog sys$login SYS$SYSROOT:[W_MCGAW]
$ set def SYS$SYSDEVICE:[W_MCGAW]
$ create ls.txt
pwd
ls
$ sftp "-Bls.txt" W_MCGAW@HOSER
Welcome to OpenVMS (TM) Alpha Operating System, Version V8.3
Warning: Converting file ls.txt to Stream_LF.
Warning: File ls.txt converted successfully to Stream_LF.
sftp> pwd
SYS$SYSDEVICE:[W_MCGAW]
sftp> ls
.
ACCOUNTING_LOGS.DIR;1
BACKUP.COM;2
BACKUP.COM;1
BUILD_DCL.COM;10
CONTAINER.BCK;4
.
.
.
ZIP-ALPHA.EXE;1
W_MCGAW job terminated at 11-MAY-2011 07:35:24.41
Accounting information:
Buffered I/O count: 369 Peak working set size: 10336
Direct I/O count: 92 Peak virtual size: 189056
Page faults: 1315 Mounted volumes: 0
Charged CPU time: 0 00:00:00.07 Elapsed time: 0 00:00:02.15
This seems to do what you are looking for. Hopefully witha few small tweaks, you can make this work in your envirnoment.
If not, maybe you can log a call with HP OpenVMS Support for assistance.
Best regards,
Walt McGaw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2011 04:22 AM
тАО05-16-2011 04:22 AM
Re: SFTP in batch mode
The batch file must be created with Stream_LF format. I had used DCL Create.
Thanks anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2011 04:34 AM
тАО05-16-2011 04:34 AM