![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| BSD BSD, sometimes called Berkeley Unix, is a Unix operating system developed by the Computer Systems Research Group of the UC Berkeley. |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C/C++ IDE for FreeBSD | tos | High Level Programming | 1 | 11-22-2002 08:07 AM |
| [help]FreeBSD could use how many cpu(x86) max? | beggar_hong | UNIX for Dummies Questions & Answers | 3 | 10-21-2002 11:29 AM |
| FreeBSD - NAT | Ivo | IP Networking | 1 | 04-15-2002 05:42 PM |
| Freebsd 4.5 | Mindscan | UNIX for Dummies Questions & Answers | 1 | 03-29-2002 03:36 AM |
| need help with FreeBSD!!! | lacasa | UNIX for Dummies Questions & Answers | 3 | 02-28-2001 11:19 AM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
please help me in FreeBSD
Hi to all,
Iam doing a project in Free BSD and i am stuck with a puzzle. Please any one of you clarify my doubt : How to add a mechanism to check the status of the file system which alerts the root user via. email if any single partition is greater than 90% full. This alert should include the file system directory name and the partition? ![]() |
| Forum Sponsor | ||
|
|
|
|||
|
Atleast help me with this !!
Iam working on Free BSD 5.3 version. U all know that the output of 'df' command looks as follows:
Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/ad0s1a 253678 59116 174268 25% / devfs 1 1 0 100% /dev /dev/ad0s1e 253678 24280 209104 10% /tmp /dev/ad0s1f 8913022 2615376 5584606 32% /usr /dev/ad0s1d 253678 30246 203138 13% /var devfs 1 1 0 100% /var/named/dev Now i want to check which partition if greater than 90% full without scanning the first row of record. How to do this ? PLease anyone of u help me with this? |
|
||||
|
Quote:
It more than likely NEEDS it BADLY. =========== #!/bin/ksh get_size () { IFS="% " df -k | grep '\/dev\/' | awk '{ printf "%s\t%d\n",$6,$5 }' IFS=" " } alm_func () { LIM=$1} #======= if [ $# -ne 1 ]; then echo "$0: Invalid number of arguments"fi LIMIT=$1 alm_func $LIMIT `get_size` ====== IFS is usually "<space><tab><\n>" I add the '%' as a lazy way to make it a field delimiter and 'subtract' it from the 'df -k' output. Dirty, I know. :>D [top] |
||||
| Google UNIX.COM |