#!/bin/sh
cd $HOME/root/pedestals
mylist=`ls -1 pedestals-*.new`
REMHOST="ilcdaq@flctpc-lunddaq"
DEST=$REMHOST:/misc/ilcdaq/config-v4.1
for myfile in $mylist; do
destfile=`echo $myfile | sed -e 's/.new/.dat/'`
    echo "Copying: " $myfile "to:"  $destfile;
    scp -p $myfile $DEST/$destfile
done
DESTDIR="/misc/ilcdaq/config-v4.1"
ls -lGg --time-style=long-iso pedestals-*.new | sed -e 's/.new/.dat/' > /tmp/mylist
echo "Getting remote file list"
ssh $REMHOST "cd $DESTDIR;ls -lGg --time-style=long-iso pedestals-*.dat" > /tmp/remlist
echo "Differences in the file list"
diff /tmp/mylist  /tmp/remlist
