#/bin/csh
#
#   ys_contrib.monitor
#
#   Monitor Yohkoh user contribution area
#   Service Contributions and Requests (submitted via ys_contrib)
#   15-Feb-1994 (SLF) Written
#    7-Apr-1994 (SLF) ydb distribution support
#
# define top level contribution area
set pubmaint=/0p/ftp/pub/swmaint
#


################## Service Software Requests ##################
# check for active getlists
# define relative user areas
set requests=$pubmaint/getlists
set working=$pubmaint/working
set contribs=$pubmaint/contrib

set getlists=`/bin/ls $requests/getlist.*`
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 software requests pending"
endif
######################################################

######### Service remote ydb requests ################
# define relative user areas
set ydbrequests=$pubmaint/ydbget/remlists
set ydbworking=$pubmaint/ydbget/working
set ydbget=$pubmaint/ydbget/remget

set getlists=`/binls $ydbrequests/DIR*.*`
if ($#getlists > 0) then
   foreach list ($getlists)
      mv -f $list $ydbworking
      set newname=`echo $list | sed s/remlists/working/g`
      set jobname=$newname.pro
      echo ys_contrib,/ydbget,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 ydb requests pending
endif

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