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
----------------------------------------------------------------------