SFTP Shell Script from a Unix server to another


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SFTP Shell Script from a Unix server to another
# 1  
Old 08-18-2008
SFTP Shell Script from a Unix server to another

I am facing a typical issue for transfering files through secured FTP (SFTP)

for example, i have three different servers a,b & c
server A - where data file resides
Server B - where Unix shell program resides here(source server)
server C - Destination server

I wanted to run the shell program from Server B which fetches the data file from server A and then transfer it to Server C.

Is there any way of transferring the file directly from Server A to Server C using SFTP?

I am facing this issue because the shell program is in the application tier (which is server B in above example) and our extract program creates data file in the database server (server A in the above example) and we need to SFTP this file to a destination third-party server (server C in the above example).

Please advice.Any sample scripts would be helpful.

Thanks
Madhu
# 2  
Old 08-18-2008
Please don't double post or bump threads, it is against the forum's rules. I have answered you in your original thread, here. I've posted sample code, the rest is up to you. While I understand you may have urgent task, it takes ~ 1 hour to understand Expect and complete the whatever task you want.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Shell script to sftp files to file server.

Hi, I am looking for a shell script to sftp to a file server and copy all the files from a directory after the script is run. The server name should be a user input parameter and of-course the username/password as well. Rest all should be handled by the script. I tried with below snippet:-... (2 Replies)
Discussion started by: happysingh
2 Replies

2. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

3. Shell Programming and Scripting

Batch script to execute shell script in UNIX server

Hi team, My requirement is to transfer pdf files from windows machine to unix server and then from that unix server we should sftp to another server. I have completed the first part i.e From windows to using to unix server with the help of psftp.exe code: psftp user@host -pw password <... (1 Reply)
Discussion started by: bhupeshchavan
1 Replies

4. Shell Programming and Scripting

Sftp some files from windows server to UNIX server

hi i need to transfer some files from windows server to unix server using SFTP. but before transferring the files, i need to check the existence of a particular file in the remote directory (say r_dir1). if the file is present, then SFTP all the files. after SFTPing the files from the remote... (1 Reply)
Discussion started by: vinit raj
1 Replies

5. Shell Programming and Scripting

i want to execute shell script on remote server with in sftp session

Hi, I want to execute shell script with in sftp session for remote server. like i have a shell script test.sh that is on local server.i want to execute that script on remote server sftp user@192.168.56.10 sftp> test.sh ---execute for remote server not for local server. sftp... (3 Replies)
Discussion started by: SAUD PASHA
3 Replies

6. Shell Programming and Scripting

FTP from windows to unix server using unix shell script

Hi, Is it possible to ftp a huge zip file from windows to unix server using unix shell scripting? If so what command i need to use. thanks in advance. (1 Reply)
Discussion started by: Shri123
1 Replies

7. Shell Programming and Scripting

SFTP-how to log individual sftp command error while executing shell script

Hi, I have situation where i need to automate transferring 10000+ files using sftp. while read line do if ; then echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt fi done< files.txt sftp -b sftpCommand.txt stu@192.168.2.1 The above... (1 Reply)
Discussion started by: noobrobot
1 Replies

8. Shell Programming and Scripting

SFTP to server through Shell Script

I am sftp-ing to a server through a shell script from my local machine. sftp user@host put out.txt bye On executing the script, it prompts to enter the password, and after giving the password it successfully connects to the host.But the problem is that the remaining statements after the... (1 Reply)
Discussion started by: Kishore_1
1 Replies

9. Shell Programming and Scripting

Connecting to multiple unix server from unix server using shell script

Hi Gurus, I'm a unix newbie and I would like to connect to multiple unix servers from unix server using shell script i.e from server a to server b,c,d etc. I want to copy the files from unix server a to server b, c, d. I can access staright using ssh without the need to have password and user... (5 Replies)
Discussion started by: sexyTrojan
5 Replies

10. Shell Programming and Scripting

Use cURL in shell script and get most recent file from remote server using SFTP

I have been trying to implement the following shell script -- sftp to remote server get list of files in the directory sftp get the most recent listed file exit This script will be scheduled to be executed everyday using CRON or CONTROL-M and the need is to have absolutely no human... (7 Replies)
Discussion started by: toobrown1
7 Replies
Login or Register to Ask a Question