The sftp3g command seems to wait for input. Were it on a *nix system, I'd propose a "here document" containing the lines for sftpg3. On MS systems, I'm afraid I can't help.
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:-
.... you can then run this:-
This does depend if your sftp3g client supports it though. What is the OS and emulator (if there is one, e.g. Cygwin)
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:-
.... you can then run this:-
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
Thanks everyone. I was able to run it with -B option which is to execute in a separate file.
These 2 Users Gave Thanks to userguy For This Post:
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)
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)
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)
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)
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)
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)
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)
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)
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)