#! /bin/bash
# +
# send_pans_to_hampton.sh 
#
# Author: Dain Cilke
#
# Calling: ./send_pans_to_hampton.sh year day
#
# Purpose: Move pans that are authorized to be transfered to the hampton servers and notify them
#          of the pans arrival.
#
# Note: This script needs to be run on aimcips as aimsds
# -


echo "Sending pans for" $1"-"$2
year=$1
day=$2

find /aim/pdc/pans_pending_resp/ -name "*${year}-${day}*" -exec scp {} aim_cips@aim.hamptonu.edu:/mnt/home/aim_cips/pans/pans_pending_resp
ssh aim_cips@aim.hamptonu.edu 'perl /mnt/home/aim_cips/send_pans_from_hampton.pl'

#ssh cips_aim@aim.hamptonu.edu '/mnt/home/cips_aim/send_pans_from_hampton.pl; find /mnt/home/cips_aim/pans/pans_pending_resp/ -name "*${year}-${day}*" -exec mv {} /mnt/home/cips_aim/pans/processed_pans'
#find /aim/pdc/pans_pending_resp/ -name "*$(day)-$(year)*" -exec mv {} /aim/pdc/processed_pans

