954,546 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

FTP Shell script from windows to unix and vice versa

Hi all

can anyone please help me write a shell script for file transfer from windows to unix server and vice versa. i m new to unix shell scripting so kindly bare with the small mistakes tht i mite have made

the code is:

#!/bin/sh

filename="sample.txt"
user='user'
password='passwd'
IP='some ip'

ftp -n -i -v $IP 22 <<-END_SCRIPT > LOG_file
user $user $password
status
bin
get $filename
bye
END_SCRIPT


thanks in advance

jananis
Newbie Poster
2 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

So does it work?

What do you see in LOG_File?

Have you looked at the -d option of the FTP command?

Are there any diagnostics in your firewall (about trying to use a particular port)?

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

So does it work?

What do you see in LOG_File?

Have you looked at the -d option of the FTP command?

Are there any diagnostics in your firewall (about trying to use a particular port)?


i dont see anything in the log file, its 0 byte. i guess i m missing set up issues. may be in windows i need to enable FTP through IIS. could you please tell me those? what are the steps needed in windows side and unix side to transfer files between them. thank u

jananis
Newbie Poster
2 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: