HDD free space check


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting HDD free space check
# 1  
Old 09-25-2008
Bug HDD free space check

Hi,

I need to add a condition in a script. The script is executed only if there is free 8 Gigas space.

I know

if [] then

fi

I don't know how to write the condition on free space

Thanks
Smilie
# 2  
Old 09-25-2008
You can start from here:
Code:
 df -h | awk -v _=8 '/ad9/ && $4 ~ "[*G]" && int($4) >= _ {exit _}'
if [ $? -eq 8 ]
  then echo run  # do something here
fi


Last edited by danmero; 09-25-2008 at 11:52 PM.. Reason: make life complicated
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Check free disk space in server

Hi, I need about 500G space in one corporate solaris server. However, I am not sure which command to use to check this. There are few volume groups in the server, and I deleted unused, old volume groups to clear some space. However, now I am not sure how to check the free space itself. ... (2 Replies)
Discussion started by: anaigini45
2 Replies

2. Fedora

Need to incrwase PHYSICAL VOLUME space on hard drive with free space on it

Hi, I run Fedora 17. I created a physical volume of 30GB on a disk with 60GB of space so there is 30GB of free space. On the physical volume, I created my volume group and logical volumes. I assigned all the space in the physical volume to my volume group. I need to add the 30GB of free space... (1 Reply)
Discussion started by: mojoman
1 Replies

3. Solaris

No space left on device but free space and inodes are available...

hi guys, me again ;) i recently opened a thread about physical to zone migration. My zone is mounted over a "bigger" LUN (500GB) and step is now to move the old files, from the physical server, to my zone. We are talking about 22mio of files. i used rsync to do that and every time at... (8 Replies)
Discussion started by: beta17
8 Replies

4. Solaris

How to check free space for a metadevice in a diskset

Anyone know then command to check the unallocated disk space for a metadevice in a disk set? like: /dev/md/data/dsk/d830 Something similar to veritas command below is what I'm looking for: vxassist maxgrow <volume> ---------- Post updated at 12:34 PM ---------- Previous update was at... (1 Reply)
Discussion started by: Mr_Webster
1 Replies

5. Solaris

Check free space in Solaris Volume Manager

I 've 300Gb Lun assigned to my system which has soft partitions , is there any way to check how much the space i have used out of 300Gb ? and how may more soft partitions i can create and expand the existing ones ? (3 Replies)
Discussion started by: fugitive
3 Replies

6. Solaris

Check free space in SVM

how can we check the free space in SVM for a LUN .. I 've a 300G LUN and created several soft partitions on it but now i want to know how much i can grow .. i.e how much space is left on this 300G LUN (4 Replies)
Discussion started by: fugitive
4 Replies

7. Red Hat

Free space of HDD ?

Friends , Using which command I can see the free space or usage of the Total HDD in Linux RHEL ? suppose Imy HDD is 10GB space . I have to insall RHEL 5 using 6 GB space . Now i have 4 GB space free in my total HDD . Now using which cammand I see this 4 GB free space ? Wating for kind... (7 Replies)
Discussion started by: shipon_97
7 Replies

8. HP-UX

HP-UX using unused HDD space

Hello, I have a system with HP-UX 11.23 installed on it. There are ~36GB of unused space on the HDD. I did a very basic installation, and it created the usual volume group /dev/vg00. When I look at the output of ioscan -funC disk, I see this (and more, but irrelevant to this post): disk ... (1 Reply)
Discussion started by: goon12
1 Replies

9. Shell Programming and Scripting

Perl script to check free disk space

hello, I have to check the free space on the disk that would work both on Windows and Unix platform e.g on C: \ for Windows and / on Unix. I could use Unix command 'df ' ( my windows system has Unix emulator cygwin and could run 'df ' as well). But I'd like not to rely on system command but... (1 Reply)
Discussion started by: susja
1 Replies

10. Solaris

Maximizing 20GB HDD space

hello All! I have sun ultra5 pc with 9GB HDD and I'm planning to add 20GB HHD for future expansion and it is coming from my old intel based pc. My problem is everytime I formatted the new HD the system only gives me the result of free space for about 2GB+ as a maximum space. I have... (1 Reply)
Discussion started by: xtian
1 Replies
Login or Register to Ask a Question