FTP by script

FTP by script

Post by Joshua W. Burt » Wed, 03 Nov 1993 15:23:38



I am trying to run FTP with a fixed script from cron, to bring my mail  
spool home over a SLIP line.  The problem, of course, is that my  
/usr/ucb/ftp (and most others I have seen) cannot source either a here
document or an executable shell from the command line.  Does anyone know a  
simple way (without getting too deeply into perl or tcl or whatnot) to  
make ftp do automatically what it would do by hand if I typed:

open foo.brown.edu
username burton
password XXXXXXXX
cd ~/somewhere
mget stuff
bye

Please reply by mail---I'll summarize.  Thanks!


 
 
 

FTP by script

Post by Ernst Schra » Wed, 03 Nov 1993 23:52:51



|> I am trying to run FTP with a fixed script from cron, to bring my mail  
|> spool home over a SLIP line.  The problem, of course, is that my  
|> /usr/ucb/ftp (and most others I have seen) cannot source either a here
|> document or an executable shell from the command line.  Does anyone know a  
|> simple way (without getting too deeply into perl or tcl or whatnot) to  
|> make ftp do automatically what it would do by hand if I typed:
|>
|> open foo.brown.edu
|> username burton
|> password XXXXXXXX
|> cd ~/somewhere
|> mget stuff
|> bye
|>
|> Please reply by mail---I'll summarize.  Thanks!
|>

You may want to try something like

ftp -i -n foo.brown.edu < ftpscript
rm -f ftpscript

where "ftpscript" contains all commands you would
normally have typed by hand. This seems to work
under hp-ux on a hp 9000/735.

Ernst

 
 
 

FTP by script

Post by Manuel A. Ugarte » Mon, 08 Nov 1993 05:22:33




>|> I am trying to run FTP with a fixed script from cron, to bring my mail  
>|> spool home over a SLIP line.  The problem, of course, is that my  
>|> /usr/ucb/ftp (and most others I have seen) cannot source either a here
>|> document or an executable shell from the command line.  Does anyone know a  
>|> simple way (without getting too deeply into perl or tcl or whatnot) to  
>|> make ftp do automatically what it would do by hand if I typed:
>|>
>|> open foo.brown.edu
>|> username burton
>|> password XXXXXXXX
>|> cd ~/somewhere
>|> mget stuff
>|> bye
>|>
>|> Please reply by mail---I'll summarize.  Thanks!
>|>

>You may want to try something like

>ftp -i -n foo.brown.edu < ftpscript
>rm -f ftpscript

>where "ftpscript" contains all commands you would
>normally have typed by hand. This seems to work
>under hp-ux on a hp 9000/735.

>Ernst

-------cut here--------cut here----------cut here-------cut here-----------
#!/bin/sh

if test $# -eq 0
then
        echo "Usage: `basename $0` file_1 [ file_2 ... ]"
        exit 1
else
        ( for i in $*
        do gawk '{ print $0 ; if( ($1 == "open") ){system("sleep 7")} }' $i | ftp -i -n
        done )
        exit 0
fi      
-------cut here--------cut here----------cut here-------cut here-----------

-the structure of "file_?" are:

open <hostname>
user <user_name> <password>
<command>
   .
   .
   .
   .

--

 
 
 

FTP by script

Post by Wayne Belono » Thu, 11 Nov 1993 03:53:41





>>|> I am trying to run FTP with a fixed script from cron, to bring my mail  
>>|> spool home over a SLIP line.  The problem, of course, is that my  
>>|> /usr/ucb/ftp (and most others I have seen) cannot source either a here
>>|> document or an executable shell from the command line.  Does anyone know a  
>>|> simple way (without getting too deeply into perl or tcl or whatnot) to  
>>|> make ftp do automatically what it would do by hand if I typed:
>>|>
>>|> open foo.brown.edu
>>|> username burton
>>|> password XXXXXXXX
>>|> cd ~/somewhere
>>|> mget stuff
>>|> bye
>>|>
>>|> Please reply by mail---I'll summarize.  Thanks!
>>|>

>>You may want to try something like

>>ftp -i -n foo.brown.edu < ftpscript
>>rm -f ftpscript

Wayne>    
Wayne>
Wayne> or try
Wayne> $ ftp -i -n <<!!
Wayne> open foo.brown.edu
Wayne> username burton
Wayne> password XXXXXXXX
Wayne> cd ~/somewhere
Wayne> mget stuff
Wayne> bye
Wayne> !!
Wayne>

- Show quoted text -

>>where "ftpscript" contains all commands you would
>>normally have typed by hand. This seems to work
>>under hp-ux on a hp 9000/735.

>>Ernst
>-------cut here--------cut here----------cut here-------cut here-----------
>#!/bin/sh
>if test $# -eq 0
>then
>        echo "Usage: `basename $0` file_1 [ file_2 ... ]"
>        exit 1
>else
>        ( for i in $*
>        do gawk '{ print $0 ; if( ($1 == "open") ){system("sleep 7")} }' $i | ftp -i -n
>        done )
>        exit 0
>fi      
>-------cut here--------cut here----------cut here-------cut here-----------
>-the structure of "file_?" are:
>open <hostname>
>user <user_name> <password>
><command>
>   .
>   .
>   .
>   .
>--


 
 
 

1. Encrypting ftp password in ftp batch script???

Help,

I'm trying to write a ftp batch script, but I want the password not to be in
plain text.  So is there a simple way to put the password in a another file that
is encrypted and then decrypt it into a variable then put that in my ftp batch
script.

Or is there a simple ksh command to encrypt/decrypt text?

Thanks.

2. Problem with modem under Linux SLS 1.03

3. "dir" format of FTP servers (was: FTP Expect script)

4. Problem installing Solaris 2.4 x86 with Intel EtherExpress Pro

5. FTP Shell Script

6. Audio on Alpha Linux

7. FTP Shell Script???

8. Using /usr/sbin/snmp_trapsend

9. Telnet/ftp in scripts?

10. Unix to NT ftp automation script

11. FTP automatic script

12. ftp batch script file?

13. Running FTP from script