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 04:06 AM
Shell/commands/scripting/c questions Necrologist Shell Programming and Scripting 3 12-15-2006 07:48 PM
few small scripting questions bebop1111116 Shell Programming and Scripting 1 09-19-2006 05:06 PM
Shell script fundamental Questions pankajkrmishra Shell Programming and Scripting 2 07-21-2006 03:14 AM
difference between AIX shell scripting and Unix shell scripting. haroonec Shell Programming and Scripting 2 04-12-2006 09:12 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-19-2001
psyjoniz psyjoniz is offline
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.
  #2 (permalink)  
Old 07-19-2001
psyjoniz psyjoniz is offline
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
Randy Randy is offline
Registered User
  
 

Join Date: Jul 2001
Posts: 8
Thumbs up

Thanks, dude!
  #4 (permalink)  
Old 07-19-2001
psyjoniz psyjoniz is offline
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
Randy Randy is offline
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
psyjoniz psyjoniz is offline
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
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 11:44 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