FTP from unix shell script to windows


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP from unix shell script to windows
# 1  
Old 12-11-2008
FTP from unix shell script to windows

Hi,

I m trying to connect/establish FTP from unix shell script to my PC.Below the script i have written

Code:
#!/bin/ksh

ftp -v -n ddcappip01.com << "EOF"
user Amit jason
bye
EOF

------------------------------ERROR--------------------------

but i m getting the below error for the above script:

ftp : Unknown host ddcappip01.com
Not connected.

------------------------------------------------------------------------
Another try i gave but this time its getting hanged in command prompt:

Code:
#!/bin/ksh

REMOTESERVER=10.99.199.80
LOGIN='Amit'
PASSWORD='jason'
ftp -n $REMOTESERVER << INPUT_END

quote USER $LOGIN

quote PASS $PASSWORD
pwd
bye

INPUT_END

How to do FTP from unix to my PC?
Also how to get the name of my PC?
And how to use ip address of my pc instead of name in my script ?

Last edited by ali560045; 12-11-2008 at 08:03 AM..
# 2  
Old 12-11-2008
So far you did nothing wrong. ftp is ftp no matter if you do it from unix to unix or unix to windows etc. Basically it is a somewhat unified File Transfer Protocol, no matter which platform it is running on.

Your problem is here:

Quote:
ftp : Unknown host ddcappip01.com
At first make sure you can reach that host from your box or else everything following will fail of course.
# 3  
Old 12-11-2008
Also when i m using the PC ip address then also i m not able to connect, but from my PC command prompt i m able to connect to my unix server.

How to achieve this using in k-shell script ..........Above i have written the code using IP address
# 4  
Old 12-11-2008
FTP service should be enabled in the destination machine.
In you case you are trying to FTP from Unix to windows. So FTP should be enabled in your windows machine.
# 5  
Old 12-11-2008
I m able to do FTP from my PC to UNIX


Thanks in advance..........

Below are the steps to set up FTP Service in Desired PC:
Code:
How do I set up Windows 2000 or XP Professional to accept FTP transfers?

Installing IIS
For Windows XP Professional systems running in the default Start menu configuration, click Start, then Control Panel, then Add or Remove Programs. In Windows 2000 (or in XP if it is set to classic Start menu view), click Start, then Settings, then Control Panel, and then double-click Add/Remove Programs.


Click Add/Remove Windows Components.


Double-click Internet Information Services. This will open another window listing the IIS subcomponents.


Check File Transfer Protocol (FTP) Server. The Common Files and Internet Information Services Snap-In boxes will also check by default. Make sure no other boxes are checked, and then click OK. 
Note: Windows may prompt you for your Windows CD at this point.

Configuring the FTP server
On the desktop or Start menu, double-click or click My Computer, and then double-click the hard drive on which you have Windows installed. 


Open the folder inetpub. Right-click the ftproot folder and select Properties.


Click the Sharing tab. Select the radio button Share this folder and click Permissions. From the list that appears, select Everyone, and then click Remove. 


Click the Add... button. In the drop-down list, select your computer's name. In the list of user groups that appears in the center scrollbox, select Users. Click Add, then OK. In the Permissions window, set the access level. If a user needs only to download files from your computer, set the access to Read. To give upload permission, also check Change. Click OK.


Create user accounts for each of the individuals who will need to access your server. You can do so by opening the Control Panel and then double-clicking the Users and Passwords icon. For each user, you will need to provide a username and domain. At IU, use the Network ID username, and enter ADS for the domain. 


In the main Control Panel window, double-click Administrative Tools, and then double-click the Computer Management icon. A new window will open. On the left, beside Services and Applications, click the + (plus sign), and then click the + (plus sign) beside Internet Information Services. 


Right-click Default FTP server and select Properties. Under "Services", make sure that Allow anonymous connections is not checked. This will prevent unauthorized access to your workstation. Click OK, and then close all windows. 
Your computer should be ready to accept FTP connections.


Last edited by ali560045; 12-11-2008 at 08:37 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

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

3. Shell Programming and Scripting

FTP from Unix Shell script to Windows Shared folder ?

Hi Before Posting my query in this forum, I have gone through various similar postings to get some idea on ftp and how to do that from unix shell script to windows server. My question is related to FTP'ing from Unix to windows shared folder My basic question is 1. Is it possible to do FTP... (4 Replies)
Discussion started by: shekharjchandra
4 Replies

4. Shell Programming and Scripting

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... (10 Replies)
Discussion started by: kavithakuttyk
10 Replies

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

6. Shell Programming and Scripting

ftp file starting with particular name on Windows box to Unix box using shell script

Hello all ! I'm trying to write a shell script (bash) to ftp a file starting with particular name like "Latest_" that is present on a Windows box to UNIX server. Basically I want to set this script in the cron so that daily the new build that is posted on the Windows box can be downloaded to the... (2 Replies)
Discussion started by: vijayb4u83
2 Replies

7. Shell Programming and Scripting

ftp from windows to unix using a perl script on unix machine

i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
Discussion started by: raksha.s
3 Replies

8. Shell Programming and Scripting

FTP Unix Box to Windows Shell Script

Hello All, Could someone help me out with this? I want to incorporate this into an existing script so the output of a SAS job can be ftp'd from our UNIX box to a directory on a drive in Windows environment. Can this be done with no extra third party software? We currently use Putty for copy... (2 Replies)
Discussion started by: Jose Miguel
2 Replies

9. Shell Programming and Scripting

Shell to FTP file from Windows to unix

I need your help for a FTP Job to be schedule to copy files from windows to Unix. in a set of time interval. My requirement is as follows. 1.Script should check whether file is available in the windows folder , if available then do FTP to unix server , and then move... (3 Replies)
Discussion started by: sandeep.kamble
3 Replies

10. Shell Programming and Scripting

ftp files from Unix to Windows through shell program

Hi, I made a shell script to allow user to ftp file to windows shared drive. Here is part of my code within my shell script: /usr/bin/ftpmtc $usr $pswd $jobno Within 'ftpmtc': #ARGUMENT: USER,PASWD,JOBNO,VER,LOG_DATE,$$ $UCB/echo "user $1 $2" > $inst_file $UCB/echo "cd prod" >> $inst_file... (7 Replies)
Discussion started by: whatisthis
7 Replies
Login or Register to Ask a Question