Sponsored Content
Top Forums UNIX for Dummies Questions & Answers formatting space usage/available reports Post 2890 by DesperateDBA on Friday 8th of June 2001 12:51:32 PM
Old 06-08-2001
Question formatting space usage/available reports

I'm really, really new to writing scripts, but have been asked to generate a report that will show available space for a disk, space used by particular subdirectories on the disk and totals. I can get the information I need with du and df and output it to a text file but I'm stumped as to how to format it.

The output I'm looking for should be similar to the attached text file (done because when I previewed my posting I lost all the formatting).

-and then repeating for each Database SID and each disk. Any tips will be greatly appreciated -better yet, if anybody has a script that does something similar that I could borrow and modify I'm certain it would improve your karma Smilie
Code:
Disk xxxx

Total Available xxxxx

Used:

   <SID1>/archivelogs  xxxxx
         /database     xxxxx
         /exports      xxxxx
         /hot backup   xxxxx
         /cold backup  xxxxx
    Total Used <SID1>  xxxxx

deleted attachment and pasted in post --oombera

Last edited by oombera; 02-18-2004 at 11:12 AM..
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
SIZE(1) 						       GNU Development Tools							   SIZE(1)

NAME
size - list section sizes and total size. SYNOPSIS
size [-A|-B|--format=compatibility] [--help] [-d|-o|-x|--radix=number] [--common] [-t|--totals] [--target=bfdname] [-V|--version] [objfile...] DESCRIPTION
The GNU size utility lists the section sizes---and the total size---for each of the object or archive files objfile in its argument list. By default, one line of output is generated for each object file or each module in an archive. objfile... are the object files to be examined. If none are specified, the file "a.out" will be used. OPTIONS
The command line options have the following meanings: -A -B --format=compatibility Using one of these options, you can choose whether the output from GNU size resembles output from System V size (using -A, or --format=sysv), or Berkeley size (using -B, or --format=berkeley). The default is the one-line format similar to Berkeley's. Here is an example of the Berkeley (default) format of output from size: $ size --format=Berkeley ranlib size text data bss dec hex filename 294880 81920 11592 388392 5ed28 ranlib 294880 81920 11888 388688 5ee50 size This is the same data, but displayed closer to System V conventions: $ size --format=SysV ranlib size ranlib : section size addr .text 294880 8192 .data 81920 303104 .bss 11592 385024 Total 388392 size : section size addr .text 294880 8192 .data 81920 303104 .bss 11888 385024 Total 388688 --help Show a summary of acceptable arguments and options. -d -o -x --radix=number Using one of these options, you can control whether the size of each section is given in decimal (-d, or --radix=10); octal (-o, or --radix=8); or hexadecimal (-x, or --radix=16). In --radix=number, only the three values (8, 10, 16) are supported. The total size is always given in two radices; decimal and hexadecimal for -d or -x output, or octal and hexadecimal if you're using -o. --common Print total size of common symbols in each file. When using Berkeley format these are included in the bss size. -t --totals Show totals of all objects listed (Berkeley format listing mode only). --target=bfdname Specify that the object-code format for objfile is bfdname. This option may not be necessary; size can automatically recognize many formats. -V --version Display the version number of size. @file Read command-line options from file. The options read are inserted in place of the original @file option. If file does not exist, or cannot be read, then the option will be treated literally, and not removed. Options in file are separated by whitespace. A whitespace character may be included in an option by surrounding the entire option in either single or double quotes. Any character (including a backslash) may be included by prefixing the character to be included with a backslash. The file may itself contain additional @file options; any such options will be processed recursively. SEE ALSO
ar(1), objdump(1), readelf(1), and the Info entries for binutils. COPYRIGHT
Copyright (c) 1991-2013 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". binutils-2.23.52.0.1 2014-06-10 SIZE(1)
All times are GMT -4. The time now is 05:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy