#!/usr/local/bin/perl -P #; Author: Jim Dumoulin #; Company: NASA / Kennedy Space Center #; Date: 2/27/98 #; #; Loop thru all database text files in the KSC Image gallery #; directory. Call WAISIndex on all the files $GalleryPhotoDir = "/www/docs/gallery/photos"; $SearchRoot = "/search/wais"; $NewNix = "newkscnix"; $OldNix = "oldkscnix"; $KSCNix = "kscnix"; $NumDirs = 0; print "\nOpening directory $GalleryPhotoDir\n"; opendir(PHOTODIR,$GalleryPhotoDir); print "Processing images from Directory $GalleryPhotoDir \n"; @AllYears = grep(/^\d/, readdir(PHOTODIR)); foreach $year (@AllYears) { $NumDirs++; $yeardir = $GalleryPhotoDir . "/$yeardir"; if ($NumDirs == 1) { print "\nInitializing Image Database\n"; print "Building Images for year $year\n"; system("waisindex -d $NewNix -r -T txt -export -t fields `find /www/docs/gallery/photos/$year/text/ -type f -name \"*-0*.txt\"`"); system("waisindex -d $NewNix -r -T txt -export -t fields `find /www/docs/gallery/photos/$year/text/ -type f -name \"*-1*.txt\"`"); system("waisindex -d $NewNix -r -T txt -export -t fields `find /www/docs/gallery/photos/$year/text/ -type f -name \"*-2*.txt\"`"); system("waisindex -d $NewNix -r -T txt -export -t fields `find /www/docs/gallery/photos/$year/text/ -type f -name \"*-3*.txt\"`"); } else { print "Building Images for year $year\n"; ### system("waisindex -d $NewNix -a -T txt -export -t fields `find /www/docs/gallery/photos/$year/text -type f -name \"*.txt\"`"); system("waisindex -d $NewNix -a -T txt -export -t fields `find /www/docs/gallery/photos/$year/text/ -type f -name \"*-0*.txt\"`"); system("waisindex -d $NewNix -a -T txt -export -t fields `find /www/docs/gallery/photos/$year/text/ -type f -name \"*-1*.txt\"`"); system("waisindex -d $NewNix -a -T txt -export -t fields `find /www/docs/gallery/photos/$year/text/ -type f -name \"*-2*.txt\"`"); system("waisindex -d $NewNix -a -T txt -export -t fields `find /www/docs/gallery/photos/$year/text/ -type f -name \"*-3*.txt\"`"); } } #; Now, bring the new databases online print "Bringing new Nix Database online\n"; print "Stopping WAIS\n"; # system("/sbin/rc3.d/S67wais stop"); # system("/search/wais/newnix_online"); # system("/sbin/rc3.d/S67wais start");