The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Questions on shell execution stevefox Shell Programming and Scripting 6 11-20-2007 12:06 AM
Shell/commands/scripting/c questions Necrologist Shell Programming and Scripting 3 12-15-2006 03:48 PM
few small scripting questions bebop1111116 Shell Programming and Scripting 1 09-19-2006 01:06 PM
Shell script fundamental Questions pankajkrmishra Shell Programming and Scripting 2 07-20-2006 11:14 PM
difference between AIX shell scripting and Unix shell scripting. haroonec Shell Programming and Scripting 2 04-12-2006 05:12 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-19-2001
Registered User
 

Join Date: Jul 2001
Location: south florida
Posts: 6
questions on ftp shell scripting

did a search but was not allowed to use 'ftp' because its too short of a word.

for some reason, i can't seem to remember anything about ftp shell scripts - would someone please refresh my memory on the syntax and maybe give a short example? thanks for the time.
Forum Sponsor
  #2 (permalink)  
Old 07-19-2001
Registered User
 

Join Date: Jul 2001
Location: south florida
Posts: 6
Talking found my answer

figured i'd post it in case anyone else was looking for it as well...
============================================
inside a regular shell script, your call would look like this:
--
#!/usr/bin/sh
cd [DIR_YOU_WANT_TO_UPLOAD_FROM]
/usr/bin/ftp -ivn < [PATH_TO_FILE]/filename.ftp
============================================
inside the 'filename.ftp' your ftp commands would looke like this:
--
open [SERVER_NAME or IP_NUMBER]
user [USER_NAME] [USER_PASSWORD]
#from here you can just execute commands
#as you normally would in an ftp session
bin #(sets 'binary' mode transfer)
cd [DIR_YOU_WANT_TO_UPLOAD_IN]
put [FILES_YOU_WANT_TO_UPLOAD]
bye
============================================
  #3 (permalink)  
Old 07-19-2001
Registered User
 

Join Date: Jul 2001
Posts: 8
Thumbs up

Thanks, dude!
  #4 (permalink)  
Old 07-19-2001
Registered User
 

Join Date: Jul 2001
Location: south florida
Posts: 6
n/p

ya know, i'm honestly suprised i couldn't find a single example of an ftp shell script on the internet - i actually ended up digging it out of my archives. you would think that with so many people asking about it that there would've been one. gotta start somewhere i guess.
  #5 (permalink)  
Old 07-19-2001
Registered User
 

Join Date: Jul 2001
Posts: 8
I know, it's weird. I always did ftp by hand, so the main thing that I was wondering was how to pass the username and password to the program. I also changed

"/usr/bin/ftp -ivn < [PATH_TO_FILE]/filename.ftp" to

"/usr/bin/ftp -ivn < [PATH_TO_FILE]/filename.ftp >logfile 2>&1 &"

so that I could get a log file with errors and output to check it later and run it in the background since I plan to shcedule it to run at certain inetrvals.

Anyway, thanks again!
  #6 (permalink)  
Old 07-19-2001
Registered User
 

Join Date: Jul 2001
Location: south florida
Posts: 6
nice .. i'll have to modify mine as well - thanks for the tid-bit
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:04 PM.


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 Global Fact Book

Content Relevant URLs by vBSEO 3.2.0