![]() |
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 |
| need shell script to get last 10 char from a file name and write in to a new file | raj0390 | Shell Programming and Scripting | 2 | 07-28-2008 07:09 AM |
| Need to write a script in UNIX to find a file if another file exists | mmdawg | Shell Programming and Scripting | 1 | 05-04-2008 10:40 PM |
| PHP Script that sends mail - Postfix breaks it | boopfm523 | Shell Programming and Scripting | 0 | 03-05-2008 11:38 PM |
| How to write a shell script to send an email to an id | madhumathikv | Shell Programming and Scripting | 4 | 10-23-2007 05:19 PM |
| Email message if file size > 0 bytes | poste_d_ordure | Shell Programming and Scripting | 1 | 06-02-2006 07:02 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Code:
/bin/find /path/tofile -name filename.whatever -size +10485760c > ./big.dat
if [[ -s ./big.dat ]] ; then
big.dat > /usr/bin/mailx -s 'file too big ' usename@foo.com
fi
|
|
||||
|
Thanks for your reply..
i have something which i didnt get.. /bin/find /path/tofile -name filename.whatever -size +10485760c > ./big.dat i have several files (*.txt) under the /var/opt/abc, then also is this command work? what I'm looking for is, as i said i have serveral files (*.txt) under the /var/opt/abc. if any of the file increased to more than 1mb, then i wanna send a mail with increased file name and size. Thanks once again. |
|
||||
|
Thanks for your reply.
I just tried with the script which you give me and it did work with some changes. I modified the script like below find -name core.* -size +10485760c > ./big.txt #if [[ -s ./big.txt ]] ; then #big.txt > /usr/bin/mailx -s 'file too big ' abc@xyz.com this works but I want to see file size too like this.. -rw------- 1 root root 254517248 Aug 4 21:36 core.2909 and this line i wanna send as a mail. when I tried with this... /bin/find /path/tofile -name filename.whatever -size +10485760c > ./big.dat It says couldn't find the /bin/find. Thanks for your help. |
|
|||||
|
try this....
ls -lrt|awk '$5 > 10485760 {print}' > ./big.txt if [[ -s ./big.txt ]] ; then /usr/bin/mailx -s 'file too big ' abc@xyz.com < big.txt Last edited by vidyadhar85; 08-12-2008 at 10:01 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|