#! /bin/bash
# $Id: gridka_copytod0mino.sh,v 1.11 2003/11/25 12:27:29 wicke Exp $
#

# Source whatever is needed to make D0 UPS "setup" available:
# GridKa needs:
. /grid/fzk.de/software/d0/etc/profile

#
setup sam_cp
setup sam_gridftp

# Get working directory and add to PATH:
OLDPWD=$PWD
cd `dirname $0`
export PATH=$PATH:$PWD
cd $OLDPWD

# List of space separated full paths where tagfiles 
# could appear (subdirectories will be searched):
export RERECO_RESULT_DIRS="/grid/fzk.de/d0/d0-5/nunne/reprocessing_test2/dest/d0reco/"

# Directory in which files to tag successfull copying to FNAL will be created
# Use "." if you want it in the same directory as the production tagfile.
export RERECO_SUCCESS_TAGFILE_DIR="/grid/fzk.de/home/sam/reprocessing/tags"

# If not defined until no define your SAM_STATION name
if [ -z $SAM_STATION ]; then
  export SAM_STATION=unknown
fi
export RERECO_TARGET="d0mino.fnal.gov:/sam/remote_merge/$SAM_STATION/incoming"

# Filename pattern for tagfiles (we put recoST*.tagfile to avoid copying DSTs)
export RERECO_TAGFILE_PATTERN="recoT_*.tagfile"

# call Hendriks skript
echo "Copy to $RERECO_TARGET starting...   ("`date`")"
./tagcopy.sh copy.sh 
echo "Copy to $RERECO_TARGET ended.        ("`date`")"
#

