#!/bin/tcsh
##########################################################################
#
# routine: clnxxx
#
# purpose: Wipes out all files and subdirs and the request-specific
#          directory itself (EVERYTHING).
#
# modification history:
#
#   date     opr     who       reason
# -------- --------  --------- --------------------------------------
# 06/01/00 43165     MSwam     first version
# 03/12/01 43165_05  MSwam     add dan cleanup
# 03/23/01 43165_07  MSwam     cleanup both pod locations and extensions
# 03/29/01 43165_10  MSwam     add cleanup of reservation OSFs
# 04/04/01 43165_11  MSwam     ignore missing .rsvlist file (when flushing)
# 04/18/01 43165_20  MSwam     remove extra asn trailers
# 09/26/01 44293     MSwam     handle multiple OSFs for request (e.g. q/s split)
# 08/15/03 47755     Sherbert  get Warning about chmod correct and loose \n's
#                              Add wildcard to get pods left behind
#                              Warn about cleanups that fail in case of problem like above
#                              Clean up with CL=v or CL=w
# 08/28/03 47755     Sherbert  Another wildcard and one less block
# 10/22/03 47755     Sherbert  Take out lines covered by unreserve.pl
# 12/09/04 49854     MSwam     Add deletion to catch WF2 asn files and lock dir
# 01/14/11 67112     MSwam     Change to csh, just wipe it clean
##########################################################################
#
set opustime = ( eval "date '+%Y%j%H%M%S'" )
#
# DELETE all files and subdirs for this request
echo "`${opustime}`-I-INFO cleaning up from : ${OUTPATH}/${OSF_DATASET}"
\rm -rf ${OUTPATH}/${OSF_DATASET}/
if ($status != 0) then
   echo "`${opustime}`-E-ERROR-FAILED to remove OTFR request-specific dir: ${OUTPATH}/${OSF_DATASET}"
   exit 1
endif
exit 0
