[mrtg] Re: FTP Perl script or client needed

Fulton L. Preston Jr. fulton at prestons.org
Wed May 16 05:15:51 MEST 2001


Jason,

You can automate FTP with NT (or Win9X/2000/XP) by using the following
command from a command line interface:

ftp -s:somefile.txt hostname.com

The "somefile.txt" should look like this:

anonymous
guest at unknown
ls
cd /somedir
bin
get filename.type
bye

Basically, just enter the command you would normally type yourself.

The "-s" switch may contain full path to the file i.e.
C:\ftpdir\ftpcommands.txt

I use this method with the NT scheduler to automate downloads from
anonymous servers of files that are updated daily.  I would never
schedule an FTP across the Internet that sends plain text passwords.  I
only use this for anonymous servers and internally behind firewalls.

For those wanting to do this on unix based boxes a ".netrc" file with
perms of -rw------- (600) needs to be in the home directory of the user
executing the "ftp" command.  To activate the "automated" ftp all you do
is issue the command (either command line or cron) of "ftp
hostname.domain.com" and the ftp client looks for the .netrc file in the
path of the user and it checks the permissions, they have to be correct.
The .netrc file would look like this:

machine ftp.nai.com login anonymous password guest
macdef init
cd pub/antivirus/datfiles/4.x
bin
prompt
hash
mget dat-*.tar
close
bye


This example gets the latest McAfee virus definitions from ftp.nai.com
for unix machines and prints hash marks showing the progress of the
download.

Hope this helps,
Fulton Preston





-----Original Message-----
From: Jason Ertel [mailto:jasone at NETOPS.IDT.NET]
Sent: Tuesday, May 15, 2001 15:11
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] FTP Perl script or client needed




All,

Does anyone know of a Perl script or automated FTP client (for an NT
box)?
My MRTG machine is behind a firewall and I would like to post the
html/images
to public a webserver server throughout the day...

Thank you,
Jason

 


======================================================================
  ________
  \______/   Jason Ertel                 Phone: (201) 928-4325
   \____/    Mgr. Network Services       FAX:   (201) 928-0156
    \__/     IDT Corporation             EMail: jasone at netops.idt.net
     \/            http://dedicated.idt.net/~jertel

======================================================================


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list