questions on ftp shell scripting


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers questions on ftp shell scripting
# 1  
Old 07-19-2001
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  
Old 07-19-2001
Computer 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  
Old 07-19-2001
MySQL

Thanks, dude!
# 4  
Old 07-19-2001
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  
Old 07-19-2001
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  
Old 07-19-2001
nice .. i'll have to modify mine as well - thanks for the tid-bit
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP a file using Shell Scripting (Help needed)

the requirements is to have a linux script which connects to a windows machine using ftp command and check for a flag file if found copy a .csv file into current machine. (3 Replies)
Discussion started by: tradingspecial
3 Replies

2. Shell Programming and Scripting

Shell scripting errors for ftp process

Hi i am facing problem in shell scripting for ftp process getting following errors here is the script & result vi GtpTxnlogs_ftp.sh "GtpTxnlogs_ftp.sh" 40 lines, 921 characters #!/usr/bin/bash ###################################################################################### #... (4 Replies)
Discussion started by: Sarmistha
4 Replies

3. Shell Programming and Scripting

Shell Scripting for creating ftp and transfer file

Dear All, We run backup script to update backup file every hour. I want to create a script, which transfer these files in another server using ftp as new backup file created every hour. Files should be stored with a unique name for every hour(e.g 20130708_13:00 , 20130708_14:00 and so on) and... (13 Replies)
Discussion started by: Preeti Saini
13 Replies

4. Homework & Coursework Questions

Scripting questions

I have two scripts and wish to finish the labs in two days, I am not sure how to make these work though. Any help would be appreciated, a step by step guide would be great! Q1) Complete the following instructions and submit the questions and answers from this lab to your tutor. Please... (1 Reply)
Discussion started by: noobie123
1 Replies

5. Shell Programming and Scripting

Shell scripting questions

I have a file like this. Pls help me to solve this. 08-24-2010 10:22:34,xxxxxxxxMessage : 111 08-24-2010 10:24:38,xxxxxxxbMessage : 000 08-24-2010 11:28:11,xxxxxxxcMessage : 111 08-24-2010 11:32:35,xxxxxxxdMessage : 111 08-24-2010 11:32:35,xxxxxxxeMessage : 111 (I should look for Message... (1 Reply)
Discussion started by: mnjx
1 Replies

6. Shell Programming and Scripting

FTP-Shell scripting

Hi Everybody, I have come across a problem while doing FTP using shell scripting. So I request any of you can give some idea of how to go about solving the problem but i request you not to give the solution please. Because i'm a java developer newly into Unix shell progrmming and am very enthu... (1 Reply)
Discussion started by: RSC1985
1 Replies

7. Shell Programming and Scripting

Shell scripting - FTP

Can some one help with script to track ftp logins on AIX server.. (1 Reply)
Discussion started by: ddk2oo5
1 Replies

8. Shell Programming and Scripting

Shell/commands/scripting/c questions

1. Can anyone explain me what the line x=signal(SIGINT,nh); does? 2. How do I write a command to print the longest line in a file? 3. How do I write a command to print the last word of every line of a file using sed? 4. What exactly does this line do? :%s/^\(\)\(\)/\2\1/g^M... (3 Replies)
Discussion started by: Necrologist
3 Replies

9. Shell Programming and Scripting

few small scripting questions

hello everyone, i have a couple of questions about programming with shell scripts. -My question is, how do you find out how long a sequence of numbers that has just been entered is. for example If i enter 12345 the length here is 5 and 23456789 the length here is eight. I want to be able... (1 Reply)
Discussion started by: bebop1111116
1 Replies

10. Answers to Frequently Asked Questions

Automate FTP / Scripting FTP Transfers

One of our most frequent questions is how to automate ftp transfers. There are several approaches. Since I'm writing this post, we will start with my favorite technique. :) In Automated FTP task I present a simple example of my ksh co-process technique. And note that later in this thread I... (0 Replies)
Discussion started by: Perderabo
0 Replies
Login or Register to Ask a Question