The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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-21-2008 12:10 AM
automate Telnet ? tbeghain Shell Programming and Scripting 4 06-19-2007 06:09 AM
How to automate an FTP process? ksak Shell Programming and Scripting 1 10-06-2006 12:45 PM
How to automate responses djp Shell Programming and Scripting 2 06-07-2005 04:00 PM
automate an ftp job flowrats UNIX for Dummies Questions & Answers 11 07-24-2002 08:47 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-23-2005
CamTu CamTu is offline
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
  #2 (permalink)  
Old 02-23-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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.
  #3 (permalink)  
Old 02-23-2005
pressy's Avatar
pressy pressy is offline Forum Staff  
solaris cultist
  
 

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

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
  #4 (permalink)  
Old 02-23-2005
tmarikle tmarikle is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2005
Posts: 683
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
  #5 (permalink)  
Old 02-25-2005
CamTu CamTu is offline
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 10:20 AM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:54 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0