Shell script to check whether a file exist on a server
#This for UNIX server to check filesystem mounted against OV process list
#And check for process.lst file
#bash script file exists
#/usr/bin/sh
/usr/bin/hostname
echo “Number of filesysem being mounted”
bdf |awk ‘{print $6}’|wc -l
echo “Number of filesystem being monitored”
cat /opt/OV/bin/OpC/cntl/file |awk ‘{print $4}’|wc -l
PROCESSLST=/opt/OV/bin/OpC/cntl/process.lst
if [ ! -f ${PROCESSLST} ]; then
echo “${PROCESSLST} was not found on `hostname`.”
exit 1
fi
Category: Shell Scripting
