The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Automate FTP borncrazy Shell Programming and Scripting 11 02-20-2008 09:10 PM
automate Telnet ? tbeghain Shell Programming and Scripting 4 06-19-2007 03:09 AM
How to automate an FTP process? ksak Shell Programming and Scripting 1 10-06-2006 09:45 AM
How to automate responses djp Shell Programming and Scripting 2 06-07-2005 01:00 PM
automate an ftp job flowrats UNIX for Dummies Questions & Answers 11 07-24-2002 05:47 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-23-2005
Registered User
 

Join Date: Feb 2005
Posts: 46
Automate FTP

Hi all,

I got this piece of code in this forum and I can't seem to get it work. The thread already closed so I just post a new thread.

Code:
#!/usr/bin/ksh
ftp -v -n "YOUR.IP.ADD.RESS" << cmd
user "user" "passwd"
cd /distant/directory
lcd /local/directoryget ssh_install
get ( or put) your files
quit
cmd

Do I run this script from the Unix side, or the command line (c-prompt) in window side?
cd /distant/directory is the directory on the unix server where i want the file ftp to?
lcd /local/directoryget ssh_install is the directory on my window pc where i want to get the file from?

Thanks

CT
Reply With Quote
Forum Sponsor
  #2  
Old 02-23-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
This code is intended to be run on a unix computer that needs to connect to an ftp server. I don't believe that we have any code intended to run on a windows computer that need to to connect to an ftp server.
Reply With Quote
  #3  
Old 02-23-2005
pressy's Avatar
solaris cultist
 

Join Date: Aug 2003
Location: Vienna / Austria (Europe) [EARTH]
Posts: 718
........

you have to run it on unix, but i think you have to write the quit sequence like:
#!/usr/bin/ksh
command << cmd
......
....
...
..
!cmd


gP
Reply With Quote
  #4  
Old 02-23-2005
Registered User
 

Join Date: Jan 2005
Posts: 682
Quote:
Originally Posted by CamTu
Do I run this script from the Unix side, or the command line (c-prompt) in window side?
Definitely this is the UNIX side. You can use the Windows ftp to copy files in batch by using the -s argument as follows:
Code:
ftp -s:ftpscriptfilename
scriptfilename contains all of the commands that you want to send to the ftp server on UNIX.

Thomas
Reply With Quote
  #5  
Old 02-25-2005
Registered User
 

Join Date: Feb 2005
Posts: 46
It does connect to the server and everything, but it can't find the file from my share drive to put on the UNIX server. I was just wondering, if you have it automate to run at certain time. How does it know what "lcd" directory of the local machine to find the file from?

CT

Last edited by CamTu; 02-25-2005 at 07:20 AM.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:33 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0