Tuesday, September 7, 2010

Simple Script to check if file exists and invoke a operation

#Script to check the file and invoke other script
#Author- Satish Kumar
#ver 1.0
#!/bin/bash
HOME=/opt/apps/RAM
FILENAME=$HOME/DRDM_ETL.complete


if [ -e $FILENAME ]
then
cd $HOME
echo Invoking the script at `date '+%F_%H:%M'` >> DRDM_ETL.status
/opt/apps/scripts/invoke.sh
echo Removing the $FILENAME at date '+%F_%H:%M'` >> DRDM_ETL.status
rm $FILENAME
else
echo data file does not exist
fi

No comments:

Post a Comment