🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Shai Shprung Fri, 21 Feb 1997 00:00
how2 automate ftp ?
#2055
Author: Shai Shprung
Date: Fri, 21 Feb 1997 00:00
18 lines
1412 bytes
New to the Unix ftp world...
I need to ftp a file from few servers that have a daily files ready for me,
lets say at 3:00AM
so far I am using 
"ftp [server name or IP ]"
Then I need to enter my user name and password, to type "get [file name]"
and then to type "bye"
I wish I can make a cron-job that will call some PERL (or Shell) code that
will do it for me. 
I know how to add a cron job, I know to program C, PERL and some Shell, but
I don't know how to make the ftp program to work with out me around....
let say my user name is BLA_BLA and my password is AABBCCDD
can you show me, using this user-name and password how to write something
to make the ftp run with out me typing it?
Thanks, Shai

Please CC to my email ( shai@nbase.com )
Re: how2 automate ftp ?
#2054
Author: Christophe Le Bris
Date: Thu, 27 Feb 1997 00:00
46 lines
2236 bytes
Shai Shprung wrote:
> 
> New to the Unix ftp world...
> I need to ftp a file from few servers that have a daily files ready for me,
> lets say at 3:00AM
> so far I am using
> "ftp [server name or IP ]"
> Then I need to enter my user name and password, to type "get [file name]"
> and then to type "bye"
> I wish I can make a cron-job that will call some PERL (or Shell) code that
> will do it for me.
> I know how to add a cron job, I know to program C, PERL and some Shell, but
> I don't know how to make the ftp program to work with out me around....
> let say my user name is BLA_BLA and my password is AABBCCDD
> can you show me, using this user-name and password how to write something
> to make the ftp run with out me typing it?
> Thanks, Shai
> 
> Please CC to my email ( shai@nbase.com )

You can create an file called ".netrc" in your home directory.
You put the line in this file:

machine server.name login BLA_BLA password AABBCCDD

When it's done, create a text file (we will call it "textfile")
that contains the commands. For example:

cd pub
get this.file
bye

and you only have call:
# ftp server.name < textfile

and all is done :-)


-- 
LE BRIS Christophe           e-mail: Christophe.Le-Bris@ensimag.imag.fr
ENSERG/ENSIMAG 3eme annee            clebris@enserg.fr 
(architecture des systemes)  http://tperg.enserg.fr/~clebris/

 "L'erreur est humaine mais un veritable desastre necessite un
ordinateur"
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads