#! /bin/csh
# 
# Copies log files from all nightly builds.
#

set dir=`dirname $0`
set day=`date | cut -f1 -d" "`
set LOGDIR=/mcs/ftp/pub/petsc/nightlylogs

foreach TEST ($*)
  source $dir/confignightly/default
  source $dir/confignightly/${TNAME}

  $SCP $USR@${MACH}:${LOC}/build.log ${LOGDIR}/build_${BRANCH}_${CONF}_${MACH}.log ;/bin/chmod a+r ${LOGDIR}/build_${BRANCH}_${CONF}_${MACH}.log &
  $SCP $USR@${MACH}:${LOC}/configure.log ${LOGDIR}/configure_${BRANCH}_${CONF}_${MACH}.log ;/bin/chmod a+r ${LOGDIR}/configure_${BRANCH}_${CONF}_${MACH}.log &
  $SCP $USR@${MACH}:${LOC}/make.log ${LOGDIR}/make_${BRANCH}_${CONF}_${MACH}.log ;/bin/chmod a+r ${LOGDIR}/make_${BRANCH}_${CONF}_${MACH}.log &
  $SCP $USR@${MACH}:${LOC}/examples.log ${LOGDIR}/examples_${BRANCH}_${CONF}_${MACH}.log ;/bin/chmod a+r ${LOGDIR}/examples_${BRANCH}_${CONF}_${MACH}.log &
  $SCP $USR@${MACH}:${LOC}/gcov.tar.gz ${LOGDIR}/gcov/gcov_${BRANCH}_${CONF}_${MACH}.tar.gz ;/bin/chmod a+r ${LOGDIR}/gcov/gcov_${BRANCH}_${CONF}_${MACH}.tar.gz &
end
sleep 60
/bin/chmod a+r ${LOGDIR}/*
wait
/bin/chmod a+r ${LOGDIR}/*
