RE: script to check file size and date stamp
From: Vijay Raghavan (Vijay_Raghavan01_at_infosys.com)
Date: 05/20/03
- Previous message: Dilip M: "Re: CANNOT login to CDE using normal accounts!!"
- Maybe in reply to: Vijay Raghavan: "script to check file size and date stamp"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 20 May 2003 16:59:22 +0530 To: <sunmanagers@sunmanagers.org>
Thanks to MacDonell
This works fine and is a good solution
Sorry I missed the bit about the alarm, you could include that with
#!/bin/sh
FILE=<file path>
SIZE=0
while [ 0 ]
do
SIZE=`ls -l $FILE | awk '{print $5}'`
DATE=`ls -l $FILE | awk '{print $6, $7, $8}'`
if [ $SIZE -eq 0 ]
then
OSIZE=$SIZE
else
if [ $OSIZE -ne $SIZE ]
then
mailx -s "Alarm: change in file size" user@domain < "The size of
<file> changed to $SIZE bytes at $DATE"
exit 1
fi
fi
sleep 300
done
exit 0
Dennis
-----Original Message-----
From: Vijay Raghavan [mailto:Vijay_Raghavan01@infosys.com]
Sent: Tuesday, 20 May 2003 14:40
To: sunmanagers@sunmanagers.org
Subject: script to check file size and date stamp
Hi gurus
I need a script to check the date stamp and the size of a file continoulsy
every 5 minutes and give an alarm
if anything changes in that file.
Will summarize
VIJAY
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
- Previous message: Dilip M: "Re: CANNOT login to CDE using normal accounts!!"
- Maybe in reply to: Vijay Raghavan: "script to check file size and date stamp"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|