#!/bin/sh
# massload, Boone, 02/03/00
# Do a load of all lists
#
# Modifications:
# 02/03/00 Boone      Initial coding
# End Modifications

	die()
	{
		echo Load of $list failed.
		exit 1
	}

	RUN=`date +%Y%m%d-%H%M%S`

	mkdir workfiles/$RUN

	GET 'http://h-net.msu.edu/cgi-bin/brsxfer.pl?trx=listlists&pw=aK7Gd9LuuP' \
		> listoflists

	cat listoflists | while read list
	do
		banner $list >> runlog.$RUN
		GET 'http://h-net.msu.edu/cgi-bin/brsxfer.pl?trx=listfiles&list='$list'&pw=aK7Gd9LuuP' \
			> listoffiles
		cat listoffiles | while read file
		do
			NOW=`date +%Y%m%d-%H%M%S`
			echo Loading file $file with stamp $RUN >> runlog.$RUN
			./fetch_notebook_data $RUN no $list $file >> runlog.$RUN
			grep -q RESTART workfiles/$RUN/log.$file && die
		done
	done

	echo Load of all lists successful.
