#!/bin/sh

# Update segment, data quality, and frame cache information for all installations

# Shourov K. Chatterji
# shourov@ligo.caltech.edu
# 2006-Feb-26

# initialize grid proxy
echo "initializing grid certificate proxy..."
grid-proxy-init

# distribute frame caches to secondary installations
echo "distributing CIT frame cache..."
ssh shourov@ldas-pcdev1.ligo.caltech.edu \
  "rsync -az -e ssh --timeout=20 qscan/framecaches/process/framecache_*.txt \
   shourov@canopus.ligo.caltech.edu:qscan/framecaches/process"
echo "distributing MIT frame cache..."
ssh shourov@ldas-pcdev1.mit.edu \
  "rsync -az -e ssh --timeout=20 qscan/framecaches/process/framecache_*.txt \
   shourov@lancelot.mit.edu:qscan/framecaches/process"
echo "distributing LHO frame cache..."
ssh qonline@ldas-pcdev1.ligo-wa.caltech.edu \
  "rsync -az -e ssh --timeout=20 qscan/framecaches/process/framecache_*.txt \
   schatter@fortress.ligo-wa.caltech.edu:qscan/framecaches/process"
echo "distributing LLO frame cache..."
ssh qonline@ldas-pcdev1.ligo-la.caltech.edu \
  "rsync -az -e ssh --timeout=20 qscan/framecaches/process/framecache_*.txt \
   shourov@decatur.ligo-la.caltech.edu:qscan/framecaches/process"

# distribute segment lists to secondary installations
echo "distributing CIT segment lists..."
ssh shourov@ldas-pcdev1.ligo.caltech.edu \
  "rsync -az -e ssh --timeout=20 qscan/segments/S5 \
   shourov@canopus.ligo.caltech.edu:qscan/segments/"
echo "distributing MIT segment lists..."
ssh shourov@ldas-pcdev1.mit.edu \
  "rsync -az -e ssh --timeout=20 qscan/segments/S5 \
   shourov@lancelot.mit.edu:qscan/segments/"
echo "distributing LHO segment lists..."
ssh qonline@ldas-pcdev1.ligo-wa.caltech.edu \
  "rsync -az -e ssh --timeout=20 qscan/segments/S5 \
   schatter@fortress.ligo-wa.caltech.edu:qscan/segments/"
echo "distributing LLO segment lists..."
ssh qonline@ldas-pcdev1.ligo-la.caltech.edu \
  "rsync -az -e ssh --timeout=20 qscan/segments/S5 \
   shourov@decatur.ligo-la.caltech.edu:qscan/segments/"

