#!/bin/csh
#------------------------------------------------------------------
# cdbs_make_links
#
# This tool creates hard links from each file in a CDBS delivery to
# the delivery areas for these systems:
#
#	- pre-archive pipeline
#	- OTFR pipeline
#	- DSB test system
#	- DSB development system
#
# This allows each system to pick up the reference file delivery
# at its own pace, while taking up only the disk space necessary
# for one copy of the files.
#
# Run the tool from the directory containing the FITS files for the
# CDBS delivery, and the catalog and sql files.
#
# 05/06/03  MSwam      first version
#--------------------------------------------------------------------
#
# define the pick-up areas
set ROOT_DIR     = /data/cdbs1/test
set PRE_ARCH_DIR = ${ROOT_DIR}/pre_arch
set DSB_TEST_DIR = ${ROOT_DIR}/dsb_test
set DSB_DEV_DIR  = ${ROOT_DIR}/dsb_dev

# create hard links for each FITS file and for the catalog and sql files
foreach i (*.fits opus*cat opus*sql)
  echo "linking $i"
  /bin/ln -n $i $PRE_ARCH_DIR/$i
  /bin/ln -n $i $DSB_TEST_DIR/$i
  /bin/ln -n $i $DSB_DEV_DIR/$i
end
