Using SFTP and FTP to transfer data from One Remote Server To Another


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Using SFTP and FTP to transfer data from One Remote Server To Another
# 1  
Old 11-10-2011
Using SFTP and FTP to transfer data from One Remote Server To Another

HI
I need to write a script in 415univ server which should go to 534unix server and move the files from there to windows server.

I am not able to get it bcoz sftp prompt is not allowing ftp command.

Can some one plz help me

Thanks in advance
# 2  
Old 11-10-2011
sftp is not a shell. You can't type shell commands into it.

Try ssh, that is a shell.

Could you show what you tried? That'd give a better indication of what you want.

---------- Post updated at 11:52 AM ---------- Previous update was at 11:49 AM ----------

Something like this perhaps:

Code:
ssh 534unix <<EOF
ftp <<END
        <ftp commands>
END
EOF

betware that END and EOF must be at the beginning of the line with no spaces in front.
# 3  
Old 11-10-2011
Code:
ssh ftp@UMW.com 
cd /FTP/test_ftp/SC/Outbound/
ftp -inv US.com <<EOF

user $SC_USER $Y5$
cd /RD/Out
ascii
mput *


when i run this script its moving into the sever as

bash-2.05$

and thats its no further execution

Moderator's Comments:
Mod Comment Please use code tags when posting data and code samples, thank you.

Last edited by Franklin52; 11-11-2011 at 11:09 AM..
# 4  
Old 11-14-2011
ssh doesn't automatically "eat" the lines below it. To feed lines into ssh, you must actually feed them into ssh, much like you feed them into ftp.

Try the code I actually gave you.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Do I require remote login access to a windows server to transfer files from a UNIX server

Hi All I need to transfer a file from a UNIX server to a windows server. I saw that it is possible to do this using scp command by looking at the forum listed below: ... (2 Replies)
Discussion started by: vx04
2 Replies

2. UNIX for Dummies Questions & Answers

Transfer image file from local to remote with sftp

Hi. I have managed to transfer a file from remote to my raspberry pi, but I have the camera mounted on the Raspbien so I would like to transfer the image the other way. I use this line: sshpass -p 'PASSWORD' scp -- USER@ssh.servername.com:/www/cam/image.jpg /home/pi/shared/web/image.jpg (4 Replies)
Discussion started by: brickglow
4 Replies

3. IP Networking

How to transfer files from UNIX server to windows machine or vice versa using ftp or sftp commands?

hi, i want to write a shell script code which transfers files from a directory in unix server to a directory in a windows machine.. can any1 give me a sample code which uses ftp or sftp command.. thanks very much, (3 Replies)
Discussion started by: Little
3 Replies

4. Shell Programming and Scripting

Transfer files from linux server to windows using secure ftp (sftp)

HI, I have to transfer files from linux server to windows using secure ftp (sftp) .Kindly help me out. (3 Replies)
Discussion started by: manushi88
3 Replies

5. Shell Programming and Scripting

SFTP to transfer files from one server to another

Hello, i have to write a script to perform sftp from the remote server to another server. the files which are at the remote location are huge data log files which should be transfered to my server in a particular folder. could you please provide me the general code (simple )... (1 Reply)
Discussion started by: urfrnddpk
1 Replies

6. Shell Programming and Scripting

Use sftp in scripts to transfer data from mainframe to Solaris

Hi, I have a situation where in we have created shell scripts to transfer data from/to mainframe and Solaris. The scripts uses ftp commands line commands(get or put) to perform the task. Now due to security reasons, ftp will not be allowed and sftp will be used. Can anyone let me know what is... (1 Reply)
Discussion started by: bornon2303
1 Replies

7. UNIX for Dummies Questions & Answers

transfer word document using ftp,sftp

Hello All, I want to transfer some world documents from solaris server to my local PC. using FTP i can not see the content of the files. Pls. tell me some other alternative (as sftp - i have tried with sftp ip_address which is not working) . (3 Replies)
Discussion started by: artikulkarni
3 Replies

8. Shell Programming and Scripting

Transfer file from local unix server to remote server

want to remove this thread. thanks (2 Replies)
Discussion started by: indira
2 Replies

9. HP-UX

Transfer file from local unix server to remote server

want to remove the thread thanks (2 Replies)
Discussion started by: indira
2 Replies

10. Solaris

transfer data to a remote system from the tape

i need to retrieve the data from tape on to a remote system.how should i go about it can anyone please help.......its urgent (1 Reply)
Discussion started by: jack123
1 Replies
Login or Register to Ask a Question