|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Shell scripting help for checking file sizes and send a mail if the file size is greater than specified size.
################################Checking for Large files
#If no. of files> 0 then send #a mail #!/bin/sh SysName=`uname -n` echo "Checking for large files on $SysName" "for large files" Search_Dir=/opt find $Search_Dir -type f -mtime -1 -size +1024c -exec ls -ld {} ; | sort -n >/var/opt/logs/LargeFileList.log # This is not working $total="`find $Search_WM_Dir -type f -mtime -1 -size +1024c -exec ls -ld {} ; | wc -l`" #This is not working echo $total echo `cat /var/opt/logs/LargeFileList.log | wc -l` #This is not working #$ files="`cat /var/opt/webmethods/logs/LargeFileList.log | wc -l`" #This is not working #echo "The total number of files are $files" if[ `cat /var/opt/logs/LargeFileList.log | wc -l` -gt 0 ] then cat /var/optlogs/LargeFileList.log #cat /var/opt/logs/LargeFileList.log | mail -t user@yahoo.com fi |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Server Administration > Shell scripting help for checking file sizes and send a mail if the file size is greater than specified size. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|