07-07-2006
Counting Files and send an email Notification if it exceeds a limit
Hi,
I am trying to write a script to Count Files in a directory located on a remote server and send an email Notification if it exceeds a limit. The code given below doesnot check the condition and sends the mail everytime irrespective of the condition. I have put this script in the cron. Can anybody please point out the mistake I am making.
#!/bin/ksh
limit=50
file_length= rsh invuk "ssh poller "ls -ltr /var/spool/get | wc -l""
if [ $file_length -ge $limit ]; then
echo "Test mail." |mailx
xyz@yahoo.com
fi
Thanks.
Last edited by amitsayshii; 07-07-2006 at 09:11 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi EveryOne
We run CICS Sofware on our AIX Machine...
When ever some Process or Transaction loops it Takes heavy process Usage..
Is there a way that i can Get a alert message or a Message Thrown on to screen when ever a process named "cicsas" uses more that 20%... fo CPU..
I was... (4 Replies)
Discussion started by: pbsrinivas
4 Replies
2. UNIX for Dummies Questions & Answers
Everytime I try to start Discreet Flame on my Octane2 machine it keeps giving me an error message "initial log size exceeds limit--aborting"
Can anyone please help me how to fix this problem. Thanks.
Octane2
IRIX64 Release 6.5
Flame 2007 (0 Replies)
Discussion started by: dewaraja
0 Replies
3. UNIX for Advanced & Expert Users
Everytime I try to start Discreet Flame on my Octane2 machine it keeps giving me an error message "initial log size exceeds limit--aborting"
Can anyone please help me how to fix this problem. Thanks.
Octane2
IRIX64 Release 6.5
Flame 2007 (0 Replies)
Discussion started by: dewaraja
0 Replies
4. Shell Programming and Scripting
Everytime I try to start Discreet Flame on my Octane2 machine it keeps giving me an error message "initial log size exceeds limit--aborting"
Can anyone please help me how to fix this problem. Thanks.
Octane2
IRIX64 Release 6.5
Flame 2007 (6 Replies)
Discussion started by: dewaraja
6 Replies
5. Shell Programming and Scripting
Hi,
I need help in writing unix script for checking space of some directories on the system and also send an email when it reaches the threshold limit.
I have written the followng code;
#!/bin/ksh
ADMIN="me@somewhere.com"
# set alert level 80% is default
THRESHOLD=80
df | grep -E... (5 Replies)
Discussion started by: jmathew99
5 Replies
6. Shell Programming and Scripting
Hello ,
I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them .
I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies
7. Shell Programming and Scripting
Hi !
I am a newbie and never officially wrote a shell script before.
The requirement for this script is :
1) Read a file called 'bpm.log' and identify if it has a specific text such as 'this is the text'. Its a static value and that is the only text we need to read.
2) If that... (2 Replies)
Discussion started by: atechcorp
2 Replies
8. HP-UX
I have an issue with one of the processes which is showing %cpu over 120% when i issue the top command. I am looking for a script that send me an email alert when it crosses the 90% thresholds.
Appreciate your help (1 Reply)
Discussion started by: chkaiban
1 Replies
9. Shell Programming and Scripting
How can i remove a file using shell script when its size exceeds 10MB. Given that file is located in different location to the shell script where it is running? (4 Replies)
Discussion started by: vel4ever
4 Replies
10. Solaris
Hello All,
I am having an issue with ellipse environment,
Subscribing ellipse version /opt/mincom/ellipse/bs037__ora_cics_svr
.profile: ulimit: exceeds allowable limit ,
prj -l ellsupp
#ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 8192... (22 Replies)
Discussion started by: Revathi2089
22 Replies