#!/bin/bash
#
# save_uls_store_log
#
# /tmp/uls_store_test.log sichern
#########################################
#
if [ -f /etc/ulsserver.conf ]
 then
  . /etc/ulsserver.conf
fi
if [ -z "$ULSNAME" ]
 then
  ULSNAME=`hostname`
fi
#
DT="`date '+%F %T'`"
#
for f in /tmp/uls_store_test.log /tmp/ulsproxyerror.log /tmp/ulserror.log /tmp/uls_oldvalues2ulsdb.log
 do
  if [[ -s $f ]]
   then
    if mv $f ${f%.log}.txt
     then
      sleep 1
      xz ${f%.log}.txt
      send_file_value -h $ULSNAME ULS Logfiles ${f##*/} $DT ${f%.log}.txt.xz
      rm ${f%.log}.txt.xz
    fi
  fi
done
