![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
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 | ||
|
|
|
|||
|
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 ============================================ |
|
|||
|
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. |
|
|||
|
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! |