#$Author: friedel $
#$Date: 2004/02/26 16:13:45 $
#$Header: /data0/n/toaster/u/friedel/cvs/papco//papco/papco_lib/CDAWlib/metadbase,v 1.2 2004/02/26 16:13:45 friedel Exp $
#$Locker:  $
#$Revision: 1.2 $
#---------------------------------------------------------------------------
#! /bin/sh
#
# Set some shell variables
#
#  Added umask so that when the metafiles are generated they will have
#  read write permission for both owner and group. RTB 12/23/98
#  Added -n 5 so that nice mode is higher than the default. TJK 12/15/99
#  Added the cp of the sp_phys cdfmetafile to the ftp area for the umich folks. TJK 6/28/2001
#  Added call to copy MAP files into the system - they arrive in the ~mapgst account.
#  TJK 7/16/2001
#
umask 002

TOP=/ncf/rumba1/istp/
META=/home/rumba/cdaweb/metadata/
MASTERDIR=/ncf/rumba1/istp/0MASTERS
export TOP
export META
export MASTERDIR

/usr/bin/nice -n 5 /disk/rumba/johnson/Ingest/mv_files_to_db

# cp_image_to_dir will ingest IMAGE cdf's, mpeg's and sfdu's. 
# Log file is in /disk/rumba/johnson/Ingest/Image/Logs
#/usr/bin/nice -n 5 /disk/rumba/johnson/Ingest/Image/cp_image_to_dir

# cp_map_to_dir will ingest MAP cdf's into "the system".  
# Log file is in ~johnson/Ingest/Map/Logs
#/usr/bin/nice -n 5 /disk/rumba/johnson/Ingest/Map/cp_map_to_dir

# cp_wind_swe_to_dir will ingest WIND cdf's into "the system".  
# Log file is in ~johnson/Ingest/Wind/Logs
#/usr/bin/nice -n 5 /disk/rumba/johnson/Ingest/Wind/cp_wind_to_dir

# cp_ace_to_dir will ingest ACE cdf's into "the system".  
# Log file is in ~johnson/Ingest/Ace/Logs
#/usr/bin/nice -n 5 /disk/rumba/johnson/Ingest/Ace/cp_ace_to_dir

# cp_cluster_to_dir will ingest CLUSTER cdf's into "the system".  
# Log file is in ~johnson/Ingest/Cluster/Logs
#/usr/bin/nice -n 5 /disk/rumba/johnson/Ingest/Cluster/cp_cluster_to_dir

# cp_goes_to_dir will ingest GOES cdf's into "the system".  
# Log file is in ~johnson/Ingest/Goes/Logs
#/usr/bin/nice -n 5 /disk/rumba/johnson/Ingest/Goes/cp_goes_to_dir

# cp_lanl_to_dir will ingest LANL cdf's into "the system".  
# Log file is in ~johnson/Ingest/Lanl/Logs
#/usr/bin/nice -n 5 /disk/rumba/johnson/Ingest/Lanl/cp_lanl_to_dir

/usr/bin/nice -n 5 /home/rumba/cdaweb/bin/overlap /home/rumba/cdaweb/metadata/metadata_GAP || exit

/usr/bin/nice -n 5 /home/rumba/cdaweb/bin/list_CDFS || exit

/usr/bin/nice -n 5 /home/rumba/cdaweb/bin/generateDatabases || exit

/usr/bin/nice -n 5 /usr/local/lib/rsi/idl_5.2/bin/idl generate_inventory

/usr/bin/nice -n 5 /usr/local/lib/rsi/idl_5.2/bin/idl generate_inventory2

/usr/bin/nice -n 5 /usr/local/lib/rsi/idl_5.2/bin/idl generate_small

#TJK add this logic to ask for 3 days of files for the run on Sunday
#otherwise just the usual single day.
set - - `date`
if [ $2 = 'Sun' ]; then
echo "Asking for 3 days of files since its Sunday"
/usr/bin/nice -n 5 /home/rumba/cdaweb/bin/update_script.pl 3
else
/usr/bin/nice -n 5 /home/rumba/cdaweb/bin/update_script.pl 1
fi

/usr/bin/cp /home/rumba/cdaweb/metadata/sp_phys_cdfmetafile.txt /export/rumba8/ftp/pub/test/umich/.

mhmail -subject "CDAWeb tar file ready"  iku@stp.isas.ac.jp < /home/rumba/cdaweb/etc/mail_text

mhmail -subject "CDAWeb tar file ready"  gtl@mpe.mpg.de < /home/rumba/cdaweb/etc/mail_text

mhmail -subject "CDAWeb tar file ready"  C.H.Perry@rl.ac.uk < /home/rumba/cdaweb/etc/mail_text



