![]() |
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 |
| Filesystems, Disks and Memory Discuss NAS, SAN, RAID, Robotic Libraries, backups, 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 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
Last edited by hegemaro; 05-20-2006 at 07:36 AM.. |
| Sponsored Links | ||
|
|