BDF Panic script...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting BDF Panic script...
# 8  
Old 04-14-2011
Not sure either. I use HP-UX. I think df is a Linux command if I'm not mistaken.

Thanks anyway,

Quote:
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvoln 4194304 362792 3801894 9% /
Smilie
# 9  
Old 04-14-2011
try du -h and awk for the correct fields.
# 10  
Old 04-14-2011
Quote:
Originally Posted by zixzix01
Not sure either. I use HP-UX. I think df is a Linux command if I'm not mistaken.

Thanks anyway,


Smilie
You are somewhat mistaken. df is a Unix command, originally. Linux uses the same name, too.

HP-UX is the only system I know that uses bdf.

"Thanks anyway" and banging your head against a wall won't solve your problem, but if you give up that easily, then...
# 11  
Old 04-14-2011
Thank you scottn,

Sorry it's been one of those days. Still in the beginning process of learning UNIX...

Not gonna give up though...Smilie

Thank you
# 12  
Old 04-14-2011
what is the output you get when you run
Code:
/usr/bin/bdf  |awk '$0 !~ /^F/' |awk '{print $5"\t" $6}'| sed 's/'%'//'

# 13  
Old 04-14-2011
Code:
hostname(root):/home/izivanov#  /^F/' |awk '{print $5"\t" $6}'| sed 's/'%'//'   <
9       /
9       /stand
32      /workdb
17      /var
12      /var/log
2       /var/dlctmp
6       /var/db
9       /var/applogs
8       /usr
40      /usr/openv
1       /tmp
40      /scratch
22      /opt
4       /opt/qjdjava
53      /opt/rex
1       /opt/oracle
6       /opt/ohd
86      /opt/dlc102b03
4       /home3

etc
etc
        
/home   
        
/opt/enroll/src 
        
/var/public     
        
/var/kfilled


Last edited by Scott; 04-14-2011 at 05:07 PM.. Reason: Code tags
# 14  
Old 04-15-2011
... back to the beginning. Ignore Post because #3 it introduces lots of errors.

The only problems with post #1 were the unwanted {} pair on line 1 and the position of the { in the function (which somebody pointed out).

Code:
/usr/bin/bdf -l |awk '$0 !~ /^F/' |awk '{print $5"\t" $6}'| sed 's/'%'//' >/tmp/bdflist

panic ()
{
while read percent dir; do
        if [[ $percent -ge 70 ]]
        then
                echo "File System Full - `uname -n`:$dir is at $percent%"
        fi
done < /tmp/bdflist
}
panic

Ps: I changed "hostname" to "uname -n" because the "hostname" command is dangerous (much too easy to change the name of the host).


HP-UX has both "df" and "bdf".
"df -kP" and "bdf -l" output the same fields in the same order but with subtle layout differences.

Last edited by methyl; 04-15-2011 at 10:05 AM.. Reason: Removed "output".
This User Gave Thanks to methyl For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Bdf in HP-UX

Hi guys, I have to make an output of several databases we've got running on our system with the command bdf. This has to be done every 3 months. I want to put it in an scriptfile and trigger it in crontab. In the output it must display the differences in diskspace between these three monts. Any... (3 Replies)
Discussion started by: djmental
3 Replies

2. Shell Programming and Scripting

Using the output of bdf in script

Hello all, First I have an old HP-UX box(11.21) for which I need to implement file-system utilization monitoring. I choosed to use bdf and a simple for loop. However sometimes the output of bdf is as this one(this is actually form linux but the idea is the same) Filesystem ... (4 Replies)
Discussion started by: click
4 Replies

3. HP-UX

bdf hangs

hi, bdf command hangs but before it, it lists all the fstab content, so i cannot find the reason... could anybody give me any clue?? thanks a lot for your attention. regards Pablo i attach syslog Jan 14 16:30:00 sv23 vmunix: hp_dlpi_wput:Received an unrecognized primitive: 101d... (7 Replies)
Discussion started by: pabloli150
7 Replies

4. Shell Programming and Scripting

Problem with a BDF script...

Hi, I'm trying to use an old script I found of the internet a while back, I forget where its from. Its supposed to convert the bdf function and display filesystem size in MB's and line it up however it never worked... Here is the error: And here is the code: #!/usr/bin/sh echo... (3 Replies)
Discussion started by: zixzix01
3 Replies

5. Shell Programming and Scripting

Bdf output

Here is my bdf output #bdf Filesystem kbytes used avail %used Mounted on /dev/vg00/lvol3 2097152 217112 1865424 10% / /dev/vg00/lvol1 1835008 329040 1494288 18% /stand /dev/vg00/lvol7 10485760 7864080 2601240 75% /var /dev/vg00/lvol8 8454144 486597 7469647 ... (5 Replies)
Discussion started by: indrajit_renu
5 Replies

6. Shell Programming and Scripting

bdf error

I have this line in a sh script: bdf | grep /var/opt/vgdb | tr -s " " | cut -f4,6 -d" " | awk '{print $2" "$1}' > vgdb_free_space.txt if I run that line in the shell it works fine but when I ran the script got this error: add_database_files.sh: line 83: bdf: command not found also I tried... (4 Replies)
Discussion started by: C|KiLLeR|S
4 Replies

7. UNIX for Advanced & Expert Users

bdf question

Hi all i am working on script which uses "bdf" output to create excel sheet now when i check "Total" "Used" & "Available" i found that except root everywhere used + available != total here is example : part from bdf output : filesystem-total-used-available-%used-Mounted on ... (4 Replies)
Discussion started by: zedex
4 Replies

8. Shell Programming and Scripting

bdf script not working !!

Hi, I have written a funtion which taken bdf output and put's in a file. The idea is to grep a areas which greater then 80% and echo the same on the system. However the script I have written fails with the error :- + awk $0 !~ /^F/ + awk {print $5"\t" $6} + sed s/%// + 1> /tmp/bdflist}... (3 Replies)
Discussion started by: kpatel786
3 Replies

9. HP-UX

df and bdf discrepencies

I've recently had some space problems on one of our old HP9000 machines. I archived/moved/compressed/trashed some stuff to free up some space on one rather large (and important) logical volume. As one would expect, when `df -b` is executed some space is shown as free: /opt ... (2 Replies)
Discussion started by: sam_pointer
2 Replies

10. UNIX for Dummies Questions & Answers

BDF test for > 90%

I am trying to write a script that will allow me to do a bdf then do a test for a percentage that is 90% or greater. If the test is true then i want to send a message to myself and one other person. Any suggestions ? ? ? Thanks. ....svp (6 Replies)
Discussion started by: svp4444
6 Replies
Login or Register to Ask a Question