Sponsored Content
Top Forums Shell Programming and Scripting Count the size and send notification Post 302624947 by MaRiOsGR on Tuesday 17th of April 2012 05:09:19 AM
Old 04-17-2012
Count the size and send notification

Hello,

I want to do something simple,

I want to count the dir size (du -sh directoryname) and then check if
it is over 100GB.
If it is more than 100GB I want to send a notification , if it less than 100GB the script can just stop.

I know how to count with du -sh and how to send an email but I dont know how to compare with 100GB, any help?

thank you.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

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... (10 Replies)
Discussion started by: amitsayshii
10 Replies

2. Shell Programming and Scripting

How to read specific line of text from a Script and send email notification

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

3. Shell Programming and Scripting

Script to read file size and send email only if size > 0.

Hi Experts, I have a script like $ORACLE_HOME/bin/sqlplus username/password # << ENDSQL set pagesize 0 trim on feedback off verify off echo off newp none timing off set serveroutput on set heading off spool Schemaerrtmp.txt select ' TIMESTAMP COMPUTER NAME ... (5 Replies)
Discussion started by: welldone
5 Replies

4. Shell Programming and Scripting

check postfix deferred mail and send notification script

Hi Guys, I have a postfix server which is deferring emails. Now I need to send notification to a specific email address if: The sender of the deferred email is: abc@example.com Contains specific subjects: a file (/opt/subjects) contains all the subjects in place Then need to send a... (0 Replies)
Discussion started by: linuxrulz
0 Replies

5. UNIX for Advanced & Expert Users

Zip the files if count is more than 0 and send a mail

All, I am new to shell scripting and trying to get the count of files that starts with error and with extension .out, if the count is greater than 0 and zip the file and send an email with the content of error.out file, here is my script cd /temp testcount =$('find . -name '*.out' -print |... (4 Replies)
Discussion started by: luckydoll
4 Replies

6. Shell Programming and Scripting

Script for count files and send mails

Hi. I'm new on this forum and I need if possible someone to help me with one script. The script should act like this: - should be run by crontab and have next parameters: script_name $par1 $par2 $par3 $par4 where script will search in dir $par1 for files with mask $par2 and if number of... (2 Replies)
Discussion started by: atrailm
2 Replies

7. UNIX for Dummies Questions & Answers

Ls directory size reporting byte size instead of file count

I have been searching both on Unix.com and Google and have not been able to find the answer to my question. I think it is partly because I can't come up with the right search terms. Recently, my virtual server switched storage devices and I think the problem may be related to that change.... (2 Replies)
Discussion started by: jmgibby
2 Replies

8. Shell Programming and Scripting

Send email based on row count

i have below code to count number of rows in file1.txt, if the row count is more than one then i have sending an email along with file1.txt attached and fail the process(do nothing if count is <=1), if I test individually count part works good but when i include the email part its not working,... (1 Reply)
Discussion started by: srini_106
1 Replies

9. Shell Programming and Scripting

Script to send email if count is >1

i have below code to count number of rows in file1.txt, if the row count is more than one then i have sending an email along with file1.txt attached and fail the process(do nothing if count is <=1), if I test individually count part works good but when i include the email part its not working,... (4 Replies)
Discussion started by: srini_106
4 Replies

10. Shell Programming and Scripting

How to monitor some UNIX process and send notification in every 10 minutes?

Hi Unix Members, Can anyone guide me to write one shell script to monitor the attach screen processes and when interrupted mail us. , like the processes - /bin/ciserver , /bin/clock , /bin/cserver , /bin/main Please looking forward you guys help. (6 Replies)
Discussion started by: biswajitnitd
6 Replies
biff(1B)					     SunOS/BSD Compatibility Package Commands						  biff(1B)

NAME
biff - give notice of incoming mail messages SYNOPSIS
/usr/ucb/biff [y | n] DESCRIPTION
biff turns mail notification on or off for the terminal session. With no arguments, biff displays the current notification status for the terminal. If notification is allowed, the terminal rings the bell and displays the header and the first few lines of each arriving mail message. biff operates asynchronously. For synchronized notices, use the MAIL variable of sh(1) or the mail variable of csh(1). A `biff y' command can be included in your ~/.login or ~/.profile file for execution when you log in. OPTIONS
y Allow mail notification for the terminal. n Disable notification for the terminal. FILES
~/.login User's login file ~/.profile User's profile file ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), mail(1), sh(1), attributes(5) SunOS 5.10 14 Sep 1992 biff(1B)
All times are GMT -4. The time now is 04:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy