#!/bin/bash
#
export LOFARSOFT=/home/$USER/lofarsoft
export PYTHONPATH="${LOFARSOFT}/release/lib/python:${LOFARSOFT}/release/share/pulsar/bin:${LOFARSOFT}/release/share/pulsar/lib/python:${LOFARSOFT}/release/share/pulsar/lib/python/coast_guard:${LOFARSOFT}/release/share/pulsar/lib/python2.6/site-packages:${PYTHONPATH}:/home/kondratiev/python/lib/python2.6/site-packages"

username=$USER
prg="/usr/bin/env python /home/$username/bin/obsinfo-cep2.py"
lockfile="/home/$username/.obsinfo-lock"

lsenodes="1-100"
#webserver="$username@10.87.15.4"  # ag004 - former dop95
webserver="$username@ag004"  # ag004 - former dop95
webaddress="$webserver:/var/www"

if [ -e $lockfile ]; then
  exit 0
fi

touch $lockfile

$prg -a --sort time -v brief --lse $lsenodes 2>&1 1>/dev/null
/home/$username/bin/web-summary-page-update.sh

dir="/home/$username/Lofar"
rsync -avxP $dir/dump.b $webaddress/lofarpwg/db

rm -f $lockfile
