Sponsored Content
Special Forums Windows & DOS: Issues & Discussions Sftp batch file not able to execute Post 303037389 by rbatte1 on Wednesday 31st of July 2019 06:09:40 AM
Old 07-31-2019
Does you client support the -b flag for sftp? That would allow you to write the commands you want in a separate file and refer to the file in your sftp command.
At the moment, the sftp command starts and will wait for input. If it were ever complete (e.g. you press CNTL-D) then the script will continue with the next command, in your case lcd D:\APPBASE\EAPSG\GEMSSG which will likely generate an error.

If you write this in a file my_sftp_commands:-
Code:
lcd D:\APPBASE\EAPSG\GEMSSG
get GENUOBGW1 /sftp/ftphrssg/HRSSG/EAPSG

.... you can then run this:-
Code:
sftpg3 -oStrictHostKeyChecking=no -oIdentityFile=EAPIINSTADM_hostnameA -b my_sftp_commands ftpeapsg@hostnameB


This does depend if your sftp3g client supports it though. What is the OS and emulator (if there is one, e.g. Cygwin)



I hope that this helps,
Robin
This User Gave Thanks to rbatte1 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

AT command to batch execute every x hours

I want to schedule a batch job (SQL)to run every 6 hours in Unix and the AT command syntax does not seem to cover this. I have created a file ncd_rpt in the directory report and have given the command in this file. at -f /report/ncd_rpt 1:00 am tomorrow I schedule this by running sh... (1 Reply)
Discussion started by: naveen79
1 Replies

2. Shell Programming and Scripting

help to execute programs in sequence through batch

I need help to create batch file . I want to run some programs in sequence in batch mode . I have one file which contains the name of program and command The test.bat file contain this data stsrun -v devel area1.exp stsrun -v devel prime1.exp stsrun -v devel treat.exp Please help... (1 Reply)
Discussion started by: getdpg
1 Replies

3. UNIX for Dummies Questions & Answers

SFTP batch script

Hi, I am running an sftp batch script. sftp -b user@host <<EOF >> /tmp/file.out binary put file.txt bye EOF However, I am getting errors. No such file or directory (user@host). I checked the forums which says I need to access the current process eg for linux I would... (3 Replies)
Discussion started by: Bab00shka
3 Replies

4. UNIX for Advanced & Expert Users

Sftp in Batch Mode

Hi, I am trying to do sftp a file from one server to another solaris server. Both are sftp enabled. I have generated the rsa key in local server and did a ftped the public key to the remote server and added that in the authorization keys file. Then i try to run the below command using a... (2 Replies)
Discussion started by: sivaemn
2 Replies

5. Shell Programming and Scripting

Batch file for sftp commands

I am trying to automate an sftp command so that it does not stop and ask for the password each time the calling shell script #!/bin/ksh sftp -b tst_1_batchfile.txt GLAXGBUPMPSOUT@204.90.134.116 the batchfile contents : password XXXXXX cd /GLAXGBUPMPSOUT/GSKENT/GLAXGF2FOPFF put... (4 Replies)
Discussion started by: Shrabanti
4 Replies

6. Programming

sftp batch programming

done for this. (4 Replies)
Discussion started by: leganti
4 Replies

7. Shell Programming and Scripting

Batch script to run in SFTP

Hello Guys, I am writting a script which is SFTPing from Solaris to Windows. I need to run a Batch script in SFTP session (ongoing) which will map a network drive and then transfer my files. I can run the Batch script via SSH but not via SFTP and this mapping is limited to that SSH... (4 Replies)
Discussion started by: Deei
4 Replies

8. Shell Programming and Scripting

How to execute a batch file containing ftp commands??

hi, is there a way i can execute a batch file containing ftp commands like we execute sftp batch file. sftp -b batchfile user@server > output how to create a batch file for ftp executing command and how to run the batch file from a shell script? (2 Replies)
Discussion started by: Little
2 Replies

9. UNIX for Advanced & Expert Users

Batch SFTP command Help

I need to run a test SFTP command in a batch mode and what I need to prompt my password after the sftp userid@hostname. I do not have have an ssh key exchanged between my server and the external server. I only have access to it as an sftp server. I must enter my password in my script. How do i... (2 Replies)
Discussion started by: mrn6430
2 Replies

10. Shell Programming and Scripting

SFTP batch not renaming file with "put"

I have a .ksh script that creates an sftp batch file and runs it through sftp. It works except for one thing. If I try to "put" to a different name, it doesn't use the specified remote name...it still "puts" the original local name. I've tried both of these, and neither work...it will always... (4 Replies)
Discussion started by: dbiggied
4 Replies
iob_new(3)						     Library Functions Manual							iob_new(3)

NAME
iob_new - create new I/O batch SYNTAX
#include <iob.h> io_batch* iob_new(int hint_entries); DESCRIPTION
iob_new creates a new I/O batch with enough space allocated for hint_entries entries (buffers or files). This is purely a performance hint, if you are unsure just pass 1. You can add buffers, strings and files to an I/O batch and then send it all at once using iob_send. The benefit of the I/O batch API is that it exploits platform specific APIs like FreeBSD's sendfile. The file contents will always be sent in a way that allows the operating systems to perform zero copy TCP, and the buffers will always be sent using as few syscalls as possible and avoiding unnecessary copying (using writev). RETURN VALUE
iob_new returns a pointer to an I/O batch data structure. If there was a memory allocation error, it returns NULL instead. SEE ALSO
iob_reset(3), iob_send(3), iob_addbuf(3), iob_adds_free(3), iob_addfile(3) iob_new(3)
All times are GMT -4. The time now is 03:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy