formatting space usage/available reports


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers formatting space usage/available reports
# 1  
Old 06-08-2001
Code:
#! /bin/ksh
#
# This will take a look at all Filesystems NOT left out in the variable FILESYSTEM and
# then find all directoy sizes listed in that filesystem and print them to standard output
# in a formated output. All sizes are in kb.
#
# by: Michael Dooley (dooley.michael@con-way.com)
#
FILESYSTEM=`df -n|grep -v proc|grep -v dev/|awk '{ print $1 }'`

for FS in ${FILESYSTEM};do
        FREE=`df -k|grep $FS|awk '{ print $4 }'`
        USED=`df -k|grep $FS|awk '{ print $3 }'`
        cd $FS
        echo "-=Disk Spaceing Script (all sizes are in kb)=-"
        echo '\t' by: dooley.michael@con-way.com
        echo DISK ${FS}
        echo
        echo TOTAL AVAILABLE $FREE
        echo
        echo USED:
        echo '\t' $FS
        for DIRECTORY in `ls ${FS}`; do
                if [[ -d $DIRECTORY ]]; then
                        du -s $DIRECTORY|awk '{ printf ("%25s\t%-10d\n", $2,$1) }'
                fi
        done
        echo TOTAL USED ${FS}"\t"$USED
        echo
done


Last edited by Optimus_P; 06-12-2001 at 01:39 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with script to display space usage

Hi all, I am looking for help with a script for displaying the space available from a df - h command for / (root). The problem is: If it is below 700 MB I have jobs that are failing... Is there a way I can do a calculation? If it above 700 MB it is good, if it is below 700 MB it will fail.... (5 Replies)
Discussion started by: gartie
5 Replies

2. Red Hat

Phantom space usage in /

Hi everyone, Got an interesting one (well, interesting to me) I have a box with a 5Gb / mount point. Checking for large files I found nothing and in fact when I did a full du I found that there was only 1.6Gb in use! And yet 100% used in / So there's an unaccounted 3.4Gb somewhere! The... (3 Replies)
Discussion started by: keefbaker
3 Replies

3. AIX

FS space usage

Hello. I have a clean-up script that deletes > 5days old files on /archive/idocs directory. This script runs twice a week, Tuesday and Friday. This creates a log file that shows the current space usage before and after the files were deleted from the directory. On Feb 3, the script ran and... (2 Replies)
Discussion started by: udelalv
2 Replies

4. HP-UX

Space usage in MB or GB

hi, In HP unix, how can check the space usage in Mb bdf will give me the output in Bytes i guess. Also, how can i check the directory size in hp unix. Thx (4 Replies)
Discussion started by: bang_dba
4 Replies

5. UNIX for Dummies Questions & Answers

Command to display the space usage (memory usage) of a specific directory.

Hi all, Can you please tell me the command, with which one can know the amount of space a specific directory has used. df -k . ---> Displays, the amount of space allocated, and used for a directory. du -k <dir name> - gives me the memory used of all the files inside <dir> But i... (2 Replies)
Discussion started by: abhisheksunkari
2 Replies

6. Shell Programming and Scripting

Space formatting issue in sed

How to remove any space around a specific charachter from a string using sed. for exmple : the string is like following str1='"name", "roll", "addr","job", "pay",' I need to remove all the spaces aronnd the commas. (8 Replies)
Discussion started by: mady135
8 Replies

7. UNIX Desktop Questions & Answers

Issue with disk space usage

Issue with disk space usage I have the following line in my "df -h" output: Filesystem Size Used Avail Capacity Mounted on /dev/ad4s1a 496M 495M -39M 109% / What is the issue with having 9% excess utilisation? How can I find out what this partition is... (2 Replies)
Discussion started by: figaro
2 Replies

8. Shell Programming and Scripting

Disk Usage - Space Used

Hi all, FreeBSD7.1 @ sh. In a backup script I am trying to get the blocks used by the backup once completed. I am using the function: #!/bin/sh spaceused() { du -d 0 "${1}" | awk -F"+" '{ print $1 } } to return the blocks used of said directory and contents. Via. command line... (7 Replies)
Discussion started by: Festus Hagen
7 Replies

9. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

10. AIX

AIX 5.3 P570 - CPU Usage reports 1500000000.003

Does anyone had an issue with AIX reporting huge CPU Usage Times for jobs? I am seeing process using ps that are reporting billions for the CPU Times. This only seems to happen once in awhile. (0 Replies)
Discussion started by: vigsgb
0 Replies
Login or Register to Ask a Question
INNDF(8)						    InterNetNews Documentation							  INNDF(8)

NAME
inndf - Report free disk, inodes, and overview information SYNOPSIS
inndf [-Fhi] [-f filename] directory [directory ...] inndf -n inndf -o DESCRIPTION
inndf was originally a replacement for "df | awk" in innwatch.ctl(5) and innstat(8), and now also reports various other usage information about INN's storage that df(1) doesn't understand. inndf doesn't sync, forks less, and is generally less complicated than df(1). Its default behavior is to report free kilobytes (not disk blocks), or free inodes if -i is used, in the file systems holding the directories given on the command line. (A kilobyte in this case is 1024 bytes.) If only one directory is given, the output will be a simple number; if more than one directory is given, the output will be formatted for human readability. If enableoverview is set to true in inn.conf, inndf can also be used to get information about the overview database. With the -n option, it reports a count of the total number of overview records stored. With -o, it reports the percentage of space used in the overview database (for those overview methods where this is meaningful data). OPTIONS
-f filename filename should contain a list of directories to use in addition to those given by the arguments, one per line. Blank lines and anything after "#" on any line are ignored. -F Like -f except that the filename is pathetc/filesystems and it is not an error if this file doesn't exist. (This option is used primarily by such things as innstat(8), so that the news administrator can add additional file systems to check to pathetc/filesystems without having to modify the script.) -h Print a usage message and exit. -i Report the number of free inodes rather than the amount of free disk space. -n Report the total number of records in the overview database. Note that crossposted articles will have one overview record for each newsgroup they're posted to. -o Report the percentage usage of the overview database space. This is only meaningful for overview methods that pre-allocate a certain amount of space rather than grow to accomodate more records. Currently, this flag is only useful for the buffindexed overview method. EXAMPLES
Print the free kilobytes in pathspool as a simple number: inndf <pathspool in inn.conf> Report the free inodes in pathnews and pathspool in a format designed for human readability: inndf -i <pathnews> <pathspool> The same, but also add in all file systems in pathetc/filesystems: inndf -i -F <pathnews> <pathspool> Print out the number of overview records and the percentage space used by a buffindexed overview database: inndf -no HISTORY
inndf was written by Ian Dickinson <idickins@fore.com>. This manual page was written by Swa Frantzen <Swa.Frantzen@belgium.eu.net>. Thanks also to the following folks for ports, patches, and comments: Mahesh Ramachandran <rr@eel.ufl.edu> Chuck Swiger <chuck@its.com> Sang-yong Suh <sysuh@kigam.re.kr> Brad Dickey <bdickey@haverford.edu> Taso N. Devetzis <devetzis@snet.net> Wei-Yeh Lee <weiyeh@columbia.edu> Jeff Garzik <jeff.garzik@spinne.com> and to all the other folks I met and worked with during my 10 years as a newsadmin. Katsuhiro Kondou added the -n and -o options. Russ Allbery added reporting of percentage free disk space. Support for -f and -F was added by Fabien Tassin <fta@sofaraway.org>. $Id: inndf.pod 8232 2008-12-14 17:05:57Z iulius $ SEE ALSO
df(1), innwatch.ctl(5), innstat(8). INN 2.5.2 2009-05-21 INNDF(8)