Hi,
With the help of below script im able to get the count of all the .xml files but that count is not specific to a day ie its the total count of all .xml files what i want is specific to 1 day and that of every half an hr ie from 23 feb 2009 7 am till 23rd feb 2009 2300 am and from 07:00 to 7:30 then 5 mins sleep time and then again 07:35 to 08:05 and so on till 2300.
the filename is of the format:
MNP_PORT_IN_P200902201800429992_20090223111443.xml
where 5th field is timestamp of foemat YYYYMMDDHHMMSS
#!/bin/sh
smsto1=0132777094
timeout=300
while :
do
TIME=`date '+%H%M'`
START=0700
END=2300
if [ $TIME -ge $START ] && [ $TIME -le $END ]
then rcvd_file_cnt=`ls -l /SYSTEM/custom/data/MNP/xmlerror | sed -n '/\([A-Z]\{3\}\)_\([A-Z]\{4\}\)_\([A-Z]\{2\}\)_P\([0-9]\{18\}\)_\([0-9]\{14\}\).xml/p' |wc -l`
echo "Count is" $rcvd_file_cnt
[ $rcvd_file_cnt -eq 0 ] && { sendsms_all.exe $smsto1 "(ALERT) Greater Than 25 files
received today."; }
[ $rcvd_file_cnt -gt 0 -a $rcvd_file_cnt -le 2 ] && { sendsms_all.exe $smsto1 "(ALERT) Greater Than 25 files received."; }
fi
sleep $timeout
done
please help in this regard.