faqts : Computers : Operating Systems : Linux

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

23 of 32 people (72%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

Linux: Ftp: Automate: How to automatically run your ftp commands?

Sep 18th, 2003 13:01
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 18 September 2003 - 07:37 pm ------------------

Linux: Ftp: Automate: How to automatically run your ftp commands?

---

Method: Use redirect of a file containing some of your ftp commands.

---

Steps: Overview:

 1. -Create some text file containing ftp commands

     e.g.

      1. -Open a console

      2. -Create a text file (e.g. using 'vi' or 'copy con')

           cat >yourfilename

      3. -Type your ftp commands, just as an example:

           open 192.168.0.3

           anonymous

           a@b.c

           lcd /home

           bin

           send ddd

           quit

      4. -Save the result, by typing

           <CTRL><D>

 2. -Redirect this created text file to the ftp command,
     by typing on the command line:

      ftp <yourfilename

 3. -This will run the ftp commands which you typed in your texfile
     automatically. So saving you from typing this commands time and
     time again manually.

---
---

Note:

You can further automate it, meaning less typing for you,
by defining an alias for running this command:

---

e.g.

type on the console command line:

 alias s='ftp <yourfilename'


e.g. if you stored that file as '/home/myftp',
you can type:

 alias s='ftp </home/myftp'

If you after that type on the command line:

 s

it will do the command 'ftp </home/myftp', which
runs your text file with commands automatically
(you will only have to supply the anonymous password,
for example a@b.c)

http://www.faqts.com/knowledge_base/view.phtml/aid/24510/fid/107

---
---

[kn, ni, th, 18-09-2003 19:37:26]

Tested and worked OK in Linux Red Hat v9.0

---

Internet: see also:

http://www.faqts.com/knowledge_base/view.phtml/aid/23670/fid/445

http://www.faqts.com/knowledge_base/view.phtml/aid/24481/fid/107

http://www.faqts.com/knowledge_base/view.phtml/aid/24489/fid/868

----------------------------------------------------------------------