Sponsored Content
Top Forums Shell Programming and Scripting Space storage shell script issue! Post 302549881 by itkamaraj on Wednesday 24th of August 2011 06:48:58 AM
Old 08-24-2011
code tag means

PHP Code:
[codeyour data [/code
---------- Post updated at 04:18 PM ---------- Previous update was at 04:16 PM ----------

Strange, why it is taking 4 as greater than 30

still checking...

Code:
 
$ nawk '/%/ {a=substr($(NF-1),1,length($(NF-1))-1); if(a > 30){print $0}}' test                                                                   
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              20G   13G  6.2G  68% /
                      400G  272G  129G  68% /oradata
                      1.1T  526G  578G  48% /orabkup
                      2.3T  1.6T  728G  69% /software
                      2.3T  1.6T  728G  69% /backup
                      2.3T  1.6T  728G  69% /patches
                      450G  170G  281G  38% /xyz_oradata
                      150G   67G   84G  45% /orabin
                      225G  106G  120G  48% /oradata_xxx
                       40G   20G   21G  48% /orabin
                       40G  1.4G   39G   4% /oradata2

 
bash-3.00$ cat test 
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              20G   13G  6.2G  68% /
/dev/sda1              99M   21M   74M  22% /boot
fcsan02:/vol/xxx_oradata
                      400G  272G  129G  68% /oradata
fcnas01:/vol/oraclebackups/xxx
                      1.1T  526G  578G  48% /orabkup
fcnas01:/vol/ebs/software
                      2.3T  1.6T  728G  69% /software
fcnas01:/vol/ebs/backup
                      2.3T  1.6T  728G  69% /backup
fcnas01:/vol/ebs/patches
                      2.3T  1.6T  728G  69% /patches
fcsan03:/vol/xxx_xxoradata
                      450G  170G  281G  38% /xyz_oradata
fcsan03:/vol/xxx_scripttest
                       20G   96K   20G   1% /scripttest
fcsan03:/vol/orabin/xxx
                      150G   67G   84G  45% /orabin
fcsan01:/vol/ebs/eptp51
                       10G  5.5M   10G   1% /ebs/eptp51
fcsan02:/vol/SnapManager_20101206155612743_xxx_oradata
                      225G  106G  120G  48% /oradata_xxx
tmpfs                 9.8G   28M  9.8G   1% /dev/shm
fcsan03:/vol/xxx_oraerp
                       40G   20G   21G  48% /orabin
fcsan03:/vol/xxx_archerp
                       40G  1.4G   39G   4% /oradata2

 

8 More Discussions You Might Find Interesting

1. AIX

how do I increase the storage space I am new to AIX

Host Name - xxxxxxx IP Address - xxxxxxxxx Alert Msg - The percentage of available storage space (DMXMemory) is low (49.54374442289481 percent). Time received - 14:23 Time Logged - 14:55 Suggested Group - MR-UNIX (5 Replies)
Discussion started by: Nyiko
5 Replies

2. Shell Programming and Scripting

Shell script partitions space monitor

Hello friends, I'm newbie in shell scripting... Until now i have this script: #!/bin/sh emailok = email1@domain.com emailissue = email2@domain.com limit="50" df -h | grep -vE '^Filesystem' | awk '{print $1 " " $4 " " $5}'|while read val do partition=$(echo $val | awk '{print... (9 Replies)
Discussion started by: john_doe
9 Replies

3. Shell Programming and Scripting

Passing Parameter containing space in between to Shell Script

Hi, I have one shell script which use two parameter however one of its parameter have space in between. eg. a.sh 20110114 b c d here b c d is one parameter I used 'b c d' but its not giving correct result. Also i tried b\c\d but this one also didnt work. Any help would be... (5 Replies)
Discussion started by: diehard
5 Replies

4. Solaris

Storage issue on T5220

We have one box T5220 which was assigned 2x100G Luns but i have a strange problem if i use powermt display it only shows me one card but cfgadm, fcinfo commands shows 2 dual port cards as up. What could be the reason for it. I already did a re-configure reboot but that didn't help. Can anyone help... (1 Reply)
Discussion started by: fugitive
1 Replies

5. Shell Programming and Scripting

Help with Disk Space script in bash shell

Hi Guys, I'm a newb at shell scripting and successfully attempted a small disk space script (victory!!) but i'm wondering whether it actually takes into consideration KB,MB,GB. Please take a look at the script and advise. ##script to check if file sys has reached threshold. ... (3 Replies)
Discussion started by: Irishboy24
3 Replies

6. Shell Programming and Scripting

Shell Script to Abort if file name has space.

Hi, In my shell script I use the following code to copy files from one directory to other. for file in `ls`; do #----------------- Copy Files From INDIR to OUTDIR -------------# echoen "Copying File ${INDIR}/$file to ${OUTDIR}/${file}" cp ${INDIR}/$file ... (4 Replies)
Discussion started by: pinnacle
4 Replies

7. Shell Programming and Scripting

Print 1 to 10 with space in shell script

Hi, I want to print 1 to 10 or upto any number sequentially with space in a single line. Like, 1 2 3 4 5 6 7 ...... In shell script only.. Can anyone plz help me. Thanks: (14 Replies)
Discussion started by: arup1980
14 Replies

8. Red Hat

Total storage space and Serial number

Hi, Could you please tell me the commands to find Total storage space and Serial number of Linux server. OS -- Red Hat Enterprise Linux Server release 6.6 (Santiago) This is 2 node cluster. Regards, Maddy (1 Reply)
Discussion started by: Maddy123
1 Replies
volfs(7FS)							   File Systems 							volfs(7FS)

NAME
volfs - Volume Management file system DESCRIPTION
volfs is the Volume Management file system rooted at root_dir. The default location for root-dir is /vol, but this can be overridden using the -d option of vold (see vold(1M)). This file system is maintained by the Volume Management daemon, vold, and will be considered to be /vol for this description. Media can be accessed in a logical manner (no association with a particular piece of hardware), or a physical manner (associated with a particular piece of hardware). Logical names for media are referred to through /vol/dsk and /vol/rdsk. /vol/dsk provides block access to random access devices. /vol/rdsk provides character access to random access devices. The /vol/rdsk and /vol/dsk directories are mirrors of one another. Any change to one is reflected in the other immediately. The dev_t for a volume will be the same for both the block and character device. The default permissions for /vol are mode=0555, owner=root, group=sys. The default permissions for /vol/dsk and /vol/rdsk are mode=01777, owner=root, group=sys. Physical references to media are obtained through /vol/dev. This hierarchy reflects the structure of the /dev name space. The default per- missions for all directories in the /vol/dev hierarchy are mode=0555, owner=root, group=sys. mkdir(2), rmdir(2), unlink(2) (rm), symlink(2) (ln -s), link(2) (ln), and rename(2) (mv) are supported, subject to normal file and direc- tory permissions. The following system calls are not supported in the /vol filesystem: creat(2), only when creating a file, and mknod(2). If the media does not contain file systems that can be automatically mounted by rmmount(1M), users can gain access to the media through the following /vol locations: +-----------------------------------+------------------------------------+ | Location | State of Media | +-----------------------------------+------------------------------------+ |/vol/dev/diskette0/unnamed_floppy | formatted unnamed floppy-block | | | device access | +-----------------------------------+------------------------------------+ |/vol/dev/rdiskette0/unnamed_floppy | formatted unnamed floppy-raw | | | device access | +-----------------------------------+------------------------------------+ |/vol/dev/diskette0/unlabeled | unlabeled floppy-block device | | | access | +-----------------------------------+------------------------------------+ |/vol/dev/rdiskette0/unlabeled | unlabeled floppy-raw device access | +-----------------------------------+------------------------------------+ |/vol/dev/dsk/c0t6/unnamed_cdrom | CD-ROM-block device access | +-----------------------------------+------------------------------------+ |/vol/dev/rdsk/c0t6/unnamed_cdrom | CD-ROM-raw device access | +-----------------------------------+------------------------------------+ For more information on the location of CD-ROM and floppy media, see System Administration Guide: Basic Administration or rmmount(1M). Partitions Some media support the concept of a partition. If the label identifies partitions on the media, the name of the media becomes a directory with partitions under it. Only valid partitions are represented. Partitions cannot be moved out of a directory. For example, if disk volume 'foo' has three valid partitions, 0, 2, and 5, then: /vol/dsk/foo/s0 /vol/dsk/foo/s2 /vol/dsk/foo/s5 for block access and /vol/rdsk/foo/s0 /vol/rdsk/foo/s2 /vol/rdsk/foo/s5 for character access. If a volume is relabeled to reflect different partitions, the name space changes to reflect the new partition layout. A format program can check to see if there are others with the volume open and not allow the format to occur if it is. Volume Management, however, does not explicitly prevent the rewriting of a label while others have the volume open. If a partition of a volume is open, and the volume is relabeled to remove that partition, it will appear exactly as if the volume were missing. A notify event will be generated and the user may cancel the operation with volcancel(1), if desired. SEE ALSO
volcancel(1), volcheck(1), volmissing(1) rmmount(1M), vold(1M), rmmount.conf(4), vold.conf(4) System Administration Guide: Basic Administration SunOS 5.10 8 Feb 1995 volfs(7FS)
All times are GMT -4. The time now is 06:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy