# This script runs everynight.  It performs various tasks, including
# arranging for itself to be run the next night.  If you don't have 
# access to the 'at' command on your machine, and want things to 
# happen automatically, you will have to figure out another way. Perhaps
# through the cron deamon.  Please note that at jobs send you mail.  While
# debugging scripts this is great since you can see whats running etc.
# but once you get things working, its a pain to delete that file 
# everyday.  Ive tried to keep mail to a minimum by haveing only this
# one file run an at, instead of each script recursing by itself.
# If you are running Sun/OS and want to delete 'at' notices automatically,
# add the lines ... to your .mailrc  (Its not perfect, but better'n'nothin')
# 	if r
#	d /"at"
# 	endif
#


# I echo the machine so I'll know where the 'at' job is running from.
# With multiple accounts, its easy to forget which machine does what.
echo 'Running ftpnightly on host: '`hostname`

# Set up tommorrows at job.  This is first so that even if something
# causes the script to fail, it will run again the next day.  Since 
# complete havok would follow if we all tried to ftp at the same time,
# I propose the following system.  Have your job run at hour:min, where
# min is Birthday * 2.  By way of example, I was born on Sep 13.  So 
# I have my job run 13 * 2 = 26 min after the hour. Of course the hour
# you chose to run at will depend on the time differential between you
# and the sites you contact.


# at 3:26am tomorrow $FTPEXTRAS/bin/ftpnightly 

# ftpcheck, will run your script for various sites. It primarily is used
# to get updated listings of files currently in the archive. Almost all
# the scripts rely on this in some way. You'll be working with outdated
# information if you don't run this.
echo 'ftpcheck'
$FTPEXTRAS/bin/ftpcheck

# summexget, this is the script that mirrors sumex.  Doing this can
# use up disk space at an alarming rate.  Please consider carefully
# before uncommenting the line. 
# echo 'summexget'
# $FTPEXTRAS/bin/mirror.sumex-aim.stanford.edu
# cd $FTPEXTRAS/mirror/sumex
# undo

# ftpdoc, will extract the TeachText and MacWrite documentation of .sit
# archives into readable text.  Puts them in /doc below the mirror.
# This requires some additional executables. See the script.
# echo ftpdoc
# $FTPEXTRAS/bin/ftpdoc
