The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > Hardware > Filesystems, Disks and Memory
.
google unix.com



Filesystems, Disks and Memory Discuss NAS, SAN, RAID, Robotic Libraries, backup devices, RAM, DRAM, SCSI, IDE, EIDE topics here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
calculating disk space for growth sholiver Filesystems, Disks and Memory 6 04-25-2008 11:28 AM
Acquia ties success to growth of Drupal iBot UNIX and Linux RSS News 0 03-17-2008 04:40 PM
File system growth *Jess* SUN Solaris 4 01-02-2007 01:03 PM
file monitoring problems High Level Programming 1 08-24-2006 08:30 AM
Monitoring file in a directory pete_leon Shell Programming and Scripting 3 11-12-2005 02:30 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-15-2006
jeyanthan_kr jeyanthan_kr is offline
Registered User
  
 

Join Date: May 2006
Posts: 1
File growth monitoring

Hi,

Can any one tell me how to find the growth of a file (monitor).

Regards,
Jey
  #2 (permalink)  
Old 05-18-2006
hegemaro hegemaro is offline
Registered User
  
 

Join Date: Feb 2006
Location: Schenectady, NY
Posts: 134
Using a simple pipeline you can get the current size of a file. Wrapping that in a script and setting a threshold would allow you to trap a file size. The following examples were executed in ksh on a Solaris 8 system but should be sufficiently generic:

Code:
$ ls -l /var/log/syslog 
-rw-r--r--   1 root     root        4109 May 18 07:30 /var/log/syslog
$ ls -l /var/log/syslog | tr -s " " "\t" | cut -f5
4109
Save that as a variable and compare:
Code:
FILESIZE=$(ls -l /var/log/syslog | tr -s " " "\t" | cut -f5)

if [ $FILESIZE -lt 10000 ]
then
    :   # no action required
else
    echo "$FILESIZE" | mailx -s "file limit reached" root
fi
And as my grandmother always said, "season to your taste." I hope this helps.

Last edited by hegemaro; 05-20-2006 at 07:36 AM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:54 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0