Visit Our UNIX and Linux User Community


shell script to ftp the files from windows to unix server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting shell script to ftp the files from windows to unix server
# 1  
Old 10-08-2009
shell script to ftp the files from windows to unix server

Hi,
I need to ftp some input files from windows to unix server.All the files will be saved in the C drive in my machine.
Currently all these files are transferring manually to the unix server.I need to write a shell script which ftp the files
from windows to unix box.When I searched in the forum i got the below mentioned script to ftp the files.It works fine when i
ftp the files from one unix server to another unix server.But it is not working when i tried from Windows to unix .I am getting the below mentioned error message.can anybody help me on this?
Code:
HOST=111.212.242.233
PASSWORD=xxxx
USER=kk1234
FILE_NAME=test1.dat
ftp -v -n ${HOST} << cmd
user ${USER} ${PASSWORD}
cd /home/kkk/test/
lcd C:\Documents and Settings\Folder1get ssh_install
ls ${FILE_NAME}
get ${FILE_NAME}
quit
cmd

ERROR MESSAGE
-------------------
Code:
ftp: connect: Connection timed out
Not connected.
Not connected.
usage:lcd local-directory


Last edited by Franklin52; 10-08-2009 at 05:50 AM.. Reason: Please use code tags!
# 2  
Old 10-08-2009
Quote:
ftp: connect: Connection timed out
Either the IP is wrong, the host is not up or there is no ftp demon running on the default ftp port 21.
Maybe try to ping 1st, check with nmap if the port 21 is open and also check if you can manually connect with a ftp client to the ftp demon.
# 3  
Old 10-08-2009
The usage error is because of the space in the directory name.
But ... "cd" refers to the remote (Windows) server and "lcd" refers to the local (unix) server.

Quote:
cd /home/kkk/test/
lcd C:\Documents and Settings\Folder1get ssh_install
Surely you mean:

Code:
cd "C:\Documents and Settings\Folder1get ssh_install"
lcd /home/kkk/test/

# 4  
Old 10-09-2009
Thanks Methyl the error with lcd has gone now.
Zaxxon,
Thanks for your suggestion
The ip address which I have given is my machine ip and it is up.I can connect from my WINDOWS dos prompt to the unix server and do the ftp process sucessfully.This error i recieve only when itry to connect to the machine ip from the unix server by using the command ftp -v -n 111.212.242.233

Regards
# 5  
Old 10-09-2009
Sounds like you have not started the FTP listener service on the Windows server ... or the Windows firewall is running with FTP blocked.
On the Windows server, can you ftp to yourself? If you can't do that there is no chance from the outside.
Code:
ftp localhost
ftp 111.212.242.233

# 6  
Old 10-12-2009
I tried this in the command prompt but i could not able to login with my password.How can I prevent the windows firewall blocking the FTP server?. Currently WinScp client has installed in my machine.Do i need to install some software like File Zilla server to try this ?Kindly Please guide me on this.
# 7  
Old 10-12-2009
What exact version of Windows are you running?

Previous Thread | Next Thread
Test Your Knowledge in Computers #380
Difficulty: Medium
Apple's macOS (previously known as Mac OS X or OS X) is a UNIX 03 registered product.
True or False?

10 More Discussions You Might Find Interesting

1. Solaris

FTP-ing files from Windows server to UNIX server

I need to transfer files from a Windows server to the Unix server and have to run some shell script on it to get the required output. Is it possible to transfer files from Windows server to unix server through any shell script? If so can you please help me with the details. Thanks in... (8 Replies)
Discussion started by: ssk250
8 Replies

2. Shell Programming and Scripting

Need Shell Script to copy files from hp UNIX to windows server 2008

Need Shell Script to copy files from hp unix to windows server 2008 I tried to google and found some options but nothing worked I want a script to copy a file in unix to windows server so I can schedule the script on daily basis.Please help me its more needful for me. Let me know if any... (4 Replies)
Discussion started by: Lucky2Bv
4 Replies

3. Shell Programming and Scripting

Unix shell script to delete files on windows server

Hi experts, can anyone suggest me on the below: how to write a shell script to search and delete files on windows server. -script runs on unix box -it should search for specific files on windows server and delete them periodically. (2 Replies)
Discussion started by: chpradeepch
2 Replies

4. 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

5. Shell Programming and Scripting

UNIX script to FTP file from UNIX server to windows

Hi, I am new to this subject.....Can someone please help me out with the script... unix usernm "sdhftst" unix pwd "chsd13" windows usernm "dfghtst" windows pwd "chsd13" path..../xxx/xxxxx/xxxxxx/xxxxxxx please can u get me a script...its only one file to get ftp. Thanks... (2 Replies)
Discussion started by: himakiran9
2 Replies

6. Shell Programming and Scripting

Unix shell script to Copy files from one Windows server to another Windows server.

Can anybody please help me on how to code for the below requirement: I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell... (4 Replies)
Discussion started by: SravsJaya
4 Replies

7. UNIX for Advanced & Expert Users

Shell script to ftp files from windows to unix

Hi , I need to ftp some input files from windows to unix server.All the files will be saved in the C drive in my machine.Currently all these files are transferring manually to the unix server.I need to write a shell script which ftp the files from windows to unix box.When I searched in the forum i... (1 Reply)
Discussion started by: kavithakuttyk
1 Replies

8. Shell Programming and Scripting

FTP from Linux to windows server by shell script

Hi, Please advice whether my below requirement is feasible, My requirement : Automated FTP from linux server to windows server using a shell script on every monday. If feasible, please help me how to do this ? Thanks in advance (2 Replies)
Discussion started by: apsprabhu
2 Replies

9. Shell Programming and Scripting

Shell Script to ftp from windows server

Hello All, I've to write a shell script to transfer some files to/from windows server. I can put & get files simply by doing ftp but need to automate this. So I tried for this -. HOST=.hostname USER='username' PASSWD='***' ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS... (8 Replies)
Discussion started by: shilpa.rajput
8 Replies

10. UNIX for Dummies Questions & Answers

Transfer files from Unix server to Windows using FTP

Dear Friend, I don't know much about unix.I am an VB6.0 Programmer.I need to move an text files as aaa.txt from unix server to windows "D: " driver using the FTP protocol.Is it possible to do this with help of unix shell script.If possible please give some sample codes. Please answer as early... (1 Reply)
Discussion started by: gjsaravanan
1 Replies

Featured Tech Videos