SunOS -s 5.10 Generic_147440-04 sun4u sparc SUNW,SPARC-Enterprise
Hi,
on one system there are folders which are being created based on today's date
/data/CDR/sswitch_roa/voice/bkup/<yyyymmdd>
(e.g /data/CDR/sswitch_roa/voice/bkup/20180620
� is the path for today�s files)
Files are being spooled in each of the daily folders that are created.
The script should verify for each day when files spooled in those folders are not being received for more than 1 hour - this will be done by checking the current timestamp of the files and if the timestamp of the files exceeds 1 hour, an email will be sent to the user.
Please find attached.
Can anyone please guide me with the script?
- I should loop the directory
DATE_DIR=`date +%Y%m%d`;
cd /data/CDR/sswitch_roa/voice/bkup/$DATE_DIR
ls *.gz > /data/CDR/sswitch_roa/voice/bkup/files
for i in `cat files`
do
<to check i's current date and if the timestamp of the file exceeds more than 1 hour, an email will be sent to the user>
if(DATE_DIR - i's current date)>1
then email...
done
Thanks,
Joe