#/bin/csh
#
#   ys_contrib.monitor
#
#   Monitor Yohkoh user contribution area
#   Service Contributions and Requests (submitted via ys_contrib)
#   
#   SLF - (circa, 1993)
#   SLF - 25-Feb-95 trap error (no files) for osf 
#
#
# define top level contribution area
set pubmaint=/0p/ftp/pub/swmaint
#
# define relative user areas
set requests=$pubmaint/getlists
set working=$pubmaint/working
set contribs=$pubmaint/contrib

################## Service Requests ##################
# check for active getlists
set getlists=`ls $requests/getlist.* >& $HOME/yscontrib.list`
if ($status) then
   exit
else
   set getlists=`cat $HOME/yscontrib.list`
endif

if ($#getlists > 0) then
   foreach list ($getlists)
      mv -f $list $working
      set newname=`echo $list | sed s/getlists/working/g`
      set jobname=$newname.pro
      echo ys_contrib,/get,file="'"$newname"'" 	>  $jobname
      echo end 		              	       >>   $jobname
      nohup /ys/gen/script/idl_batch $jobname /ys/site/logs/ys_contrib_get.$user.log &
   end
else
   echo "No requests pending"
endif
######################################################

################# Service Contributions ##############
######################################################
exit
