![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| server monitor script... | zedex | Shell Programming and Scripting | 1 | 06-01-2008 04:10 PM |
| load monitor script | locabuilt | UNIX for Advanced & Expert Users | 7 | 01-19-2007 02:37 PM |
| Hep with script to monitor directory | cmf00186 | UNIX for Dummies Questions & Answers | 2 | 10-25-2006 02:42 PM |
| Script to Monitor databases help with arrays | nelmest | Shell Programming and Scripting | 1 | 09-05-2005 10:50 PM |
| User Login Monitor Script | Drewser | Shell Programming and Scripting | 2 | 02-07-2005 04:45 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
need help doing a script to monitor if files are go through
I am trying to do a shell script to check a folder and see if files are passing through.
Now if a file did not pass through in the last 1 hour send an email. ftp----------> folder to monitor ----------->ftp Now the script that moves the file runs every sec in cron, so i do not know if i could list it to get the info. Should i write to a file? This is what i came up with so far Code:
#Set the path to the folder to monitor
SUBJECT="DWH FILES WERE NOT SENT IN THE LAST HOUR"
FILE1="/home/tibco/javastuff/test/dwh*"
cd /home/tibco/javastuff/test/
###### Run list command
ls -l
time=`echo $line | awk '{ split($8,a,":"); print (a[1]*60)+a[2] }'`
FILEMATCH=`echo $line | awk '{ print $9 }'`
if [ $FILE1 = $FILEMATCH ]
then
echo "$time" > dwhtime.txt
else
echo running else statement
######## Run date command ##########
date
time2=`echo $line | awk '{ split($4,a,":"); print (a[1]*60)+a[2] }'`
if [ $time2 -gt $time ]
then
mail -s "$SUBJECT" testemail <<EOF
$SUBJECT
$time
EOF
fi
fi
Could somebody help me out please. Last edited by jonathan184; 05-15-2007 at 04:59 PM.. Reason: put new code that i got |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|