Go to the previous, next section.

ls -lR Getter

@everyfooting Author: dhinesh // Editor: rootd // Texinfo: dhinesh @| @| 3 December 1994

The ls -lR getter acts as a bridge between the database builder and the ftp- site list builder.

This module helps in getting the ls -lR listing of each of the ftp-sites listed in the site-list database and provide it to the database builder.

Each night, the ls -lR getter will constantly do either of the following two things on each of the ftp-list.

Functions of the ls -lR Getter

  1. Determine which ls -lR files of which ftp-sites are need to be obtained
  2. Get them, and put them in the INSTALLDIR/tmp directory with the correct name(of the format ftp.cs.pdx.edu - 131.252.21.14)
  3. Move the file INSTALLDIR/tmp file to INSTALLDIR/lslr

When do we need to obtain the ls -lR listing from the remote ftp-site?

There are two reasons why ls -lR files would need to be obtained viz.,
  1. The current database files are over N days old (archie site determines N)
  2. An entry in the ftp-site list file does not have a corresponding entry in the database.

The value of N is defined as AGE in the INCLUDE/lslr.h file and is currently set to 1. The ls -lR getter will then anonymously ftp to the remote site and execute the ls -lR command. It will put the returned file in a temporary directory while it does the download, and then move it to the lslr directory once the download is complete.

The down loading to a temporary file and again moving that file to the lslr file is for the simple reason that when the ftp is doing downloading the file, there may be a situation when the database may also attempt to read the same file resulting in the inconsistency of the data.

Implementation

The module essentially utilizes a C program which is run periodically as specified by the server. The periodical activation of the program can be done using the cron() function on the UNIX.

The C Program, once activated browses the entire database and checks if any ls -lR listings of any of the ftp-sites are older than the attribute specified by the host server. If it is so, then the call for updating the database has to be given.

Also the program checks the site-list database and verifies if each of the sites has their corresponding ls -lR listing included in the database. If not, again the action is performed to add the additional listing to the database.

The above updating actions can be performed by the following way.

  1. If the ls -lR listing is older than N days( specified by the server), then a ftp request is sent to the remote ftp site.
  2. Invokes a shell script which contains the code to issue login name as guest or anonymous to the remote ftp host and issues the email address of the user as the password.
  3. The shell script issues a ls -lR command and writes the resultant listing into a file as INSTALLDIR/tmp in the archie server.
  4. Once the entire listing has been downloaded, the entire file has to be moved from the INSTALLDIR/tmp to the file INSTALLDIR/lslr. and thus is made available to the next-generation database builder for updating its data.

Go to the previous, next section.