๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.misc
Article #2054

Re: how2 automate ftp ?

#2054
From: 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"
Technical Details
Message-ID: <3315C407.78C7@ensimag.imag.fr>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <01bc1fc9$8b57b5c0$e1021d26@shai>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f8c9b,4074f2a3dd3db50b
X-Google-Attributes: gidf8c9b,public
X-Google-Thread: f72b0,4074f2a3dd3db50b
X-Google-Attributes: gidf72b0,public
X-Google-Thread: 167763,4074f2a3dd3db50b
X-Google-Attributes: gid167763,public
X-Google-Thread: 110f2c,4074f2a3dd3db50b
X-Google-Attributes: gid110f2c,public
From: Christophe Le Bris <Christophe.Le-Bris@ensimag.imag.fr>
Subject: Re: how2 automate ftp ?
Date: 1997/02/27
Message-ID: <3315C407.78C7@ensimag.imag.fr>
X-Deja-AN: 221858110
References: <01bc1fc9$8b57b5c0$e1021d26@shai>
Organization: ENSIMAG (Ecole Nationale Supรฉrieure d'Informatique et 
Newsgroups: comp.unix.misc,comp.unix.questions,fr.comp.os.unix,ftp.aminet.misc.unix