SUMMARY: automated file transfer with ftp

From: Christopher L. Barnard <>
Date: Fri Jun 20 2003 - 15:47:11 EDT
I asked:

> I realize this is a Bad Thing To Do -- it is only temporary until we can
> convince the powers-that-be that this can and should be done with scp.
> I need to fully automate an ftp transfer.  I have created the .netrc file
> to specify the hostname, the username, the (gasp) password, but I have not
> been successful in specifying the file.  I do not find the keyword to
> specify what file in the netrc man page.  I know I did this years ago, but
> I have long since stopped using ftp in favor of scp.  Is anyone still using
> ftp as a protocol for automatic file transfer?  If so, how do you specify
> the filename to be transferred?
> TIA, and I will summarize.

The answer:

since this in a shell script already, the easiest way is to
ftp hostname << EOFTP
the ftp commands to execute

Other suggestions were to put the ftp commands in a file and then pipe
that file to ftp, to use the ftp module in perl, use specialized ftp
software, use "macdef" within the .netrc file, use expect, use rsync

Thanks to everyone who responded.

| Christopher L. Barnard         O     When I was a boy I was told that |
|         / \    anybody could become president.  |
| (312) 347-4901               O---O   Now I'm beginning to believe it. |
|                --Clarence Darrow |
+----------PGP public key available via finger or PGP keyserver---------+
sunmanagers mailing list
Received on Fri Jun 20 15:50:23 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:14 EST