(file) Return to cleanup.csh CVS log (file) (dir) Up to [Development] / JSOC / proj / workflow

File: [Development] / JSOC / proj / workflow / cleanup.csh (download) / (as text)
Revision: 1.3, Thu Feb 16 20:34:13 2012 UTC (10 years, 9 months ago) by phil
Branch: MAIN
CVS Tags: Ver_LATEST, Ver_9-5, Ver_9-41, Ver_9-4, Ver_9-3, Ver_9-2, Ver_9-1, Ver_9-0, Ver_8-8, Ver_8-7, Ver_8-6, Ver_8-5, Ver_8-4, Ver_8-3, Ver_8-2, Ver_8-12, Ver_8-11, Ver_8-10, Ver_8-1, Ver_8-0, Ver_7-1, Ver_7-0, Ver_6-4, Ver_6-3, Ver_6-2, HEAD
Changes since 1.2: +2 -0 lines
Many changes

# /bin/csh -f

# set echo

if ($?WORKFLOW_ROOT) then
  set WFDIR = $WORKFLOW_DATA
  set WFCODE = $WORKFLOW_ROOT
else
  echo Need WORKFLOW_ROOT variable to be set.
  exit 1
endif

cd $WFDIR/tasks

foreach task ( * )
  pushd $WFDIR/tasks/$task
  if (!(-e retain)) continue
  set DAYS = `cat retain`
  if ($DAYS <= 0) continue
  set here = $cwd
  cd archive/ok
  find . -depth -mtime +$DAYS -print -delete 
  cd ../logs
  find . -depth -mtime +$DAYS -print -delete 
  cd ../failed
  find . -depth -mtime +10 -print -delete 
  cd $here
  set rootreturn = active/$task'-root'/ticket_return
  if (-e $rootreturn) then
    cd $rootreturn
    find . -depth -mtime +$DAYS -print -delete 
    cd $here
  endif
  popd
  end

exit 0

Karen Tian
Powered by
ViewCVS 0.9.4