Cover V05, I11


New Messages

Please send letters via email to

The following letters are in reply to a question about noninteractive file transfers that appeared in the August issue.

From: John Nelson (
The internetwork operating company, inc.

I have two suggestions for noninteractive file transfers. If you are transferring between two trusted machines, the rdist program is a very effective way to synchronize files.

$> rdist -f /path/to/distrib

the distrib file is as follows:


FILES = ( /etc/passwd /etc/shadow /etc/shadow- /etc/group )

${FILES} -> ${HOSTS}
install ;

This will copy the four important password files from the local machine to both 1 and 2. When using rdist, all the machines must trust each other by putting one another's names in the .rhosts or /etc/hosts.equiv file. rdist can be used in the crontab to be run automatically, or might be forced to run after every password update.

Another possibility is a package called mirror. This is a set of Perl scripts used to mirror WWW sites and such. The latest release of mirror no longer supports put, but you may be able to find an older version. The latest version of mirror is available from: [] directory: computing/archiving/mirror (shortcut packages/mirror); [] directory: pub/networking/mirror; or [] directory: pub/packages/mirror.

mirror is part of a family of related programs. The others are ftpmail and ftpcat. ftpmail is a mail responder, and ftpcat cats a remote file. These can be found in: and packages/ftpcat/.

From: Michael G. Phillips (
DBS@Bluewater Bay, Florida

I am assuming that the request is for running ftp within a shell script. I do this quite regularly (via cron, even) by using an alias in my /etc/hosts file and an entry in .netrc. This allows the script to invoke ftp and redirect stdin as inline or from a file.

In fact, I just used a Perl script to output cd, lcd, and put commands to rename and move files from 19 different directories on my AIX box to 19 different partitioned datasets on our MVS box. The output of the script was simply piped to an ftp command.

I know .netrc files are disliked by some people, but they sure make this process a lot simpler.

From: Kevin Erickson (
Blue Cross Blue Shield of North Dakota

I have a suggestion for anyone needing a noninteractive ftp. I've been using expect for those types of needs. expect is "A Tcl-based Toolkit for Automating Interactive Programs." O'Reilly & Associates, Inc. has published an excellent book, Exploring Expect, entirely devoted to automating things that normally can't be automated.

Below is a very simple expect script that connects to an anonymous ftp server, gets a file from /pub, and puts it back into /pub/incoming:

-- #!/usr/bin/expect --
spawn ftp $argv
expect "Name"
send "anonymous\r"
expect "word:"
send "\r"
expect "ftp> "
send "get /pub/file1 myfile\r"
expect "ftp> "
send "put myfile /pub/incoming/file2\r" expect "ftp> "
send "quit\r"
expect eof

The script could also do error checking, read a list of files to transfer from a file, etc. A sample expect script, rftp, comes with the distribution, which even does recursive ftp. A tool to go along with expect is autoexpect, which generates an expect script from watching a session.

If you want more info, check out the expect home page at:

Thank you all for your suggestions. -AA

Response to Arthur Donkers' letter in August:
In the August '96 edition of Sys Admin, there was a discussion about Linux. Donkers said, "I agree with you that 1.0.xx and 1.2.xx kernels are know as 'production' kernels and reasonably stable."

I just want to defend 1.3.xx a little bit, because where I'm working we are running a www and ftp server on a Linux box with kernel 1.3.20. This system has been up (at the time I write this) for 139 days without any failures. I would call this reasonably stable, if not more, especially when compared to an HP-UX system we have that has to be rebooted once a week. The network performance for this Linux box is better than a news box we have that runs on FreeBSD.

Eje Gustafsson (
The Aeronautical Research Institute Of Sweden