|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 idea how to do this? I'm an newbie on hp-ux
![]() |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
To schedule script every 3 months in crontab: Code:
0 0 3,6,9,12 * * script Run bdf, write to a file Code:
bdf [filesystem] | awk 'NR>1&&NF==5' > out_$(date +%b) Later you can read from files for each month and compute difference. |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thx!
Is there a way to calculate the differences between this? I mean with a script. Last edited by djmental; 01-09-2013 at 03:58 AM.. |
|
#4
|
|||
|
|||
|
Berkeley df can break the output in two lines, even if the output is not connected to a terminal (e.g. to a pipe). So it's safer to have Code:
#!/bin/ksh -p
bdf | awk 'NR>1 && NF>=5 { print $(NF-1) }' > out_$(date +%b)A post processor script (to be run in the directory with the 3 files) can look like this: Code:
#!/bin/ksh -p
ls -rt |
while read file
do
read val < $file
val=${val%%%}
if [ -z "$preval" ]
then
preval=$val
else
delta=$(($val - $preval))
printf "%s: %d (%+d)\n" $file $val $delta
fi
doneLast edited by MadeInGermany; 01-22-2013 at 08:06 AM.. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| bdf hangs | pabloli150 | HP-UX | 7 | 01-14-2012 01:31 PM |
| Bdf output | indrajit_renu | Shell Programming and Scripting | 5 | 10-18-2010 07:45 AM |
| bdf question | zedex | UNIX for Advanced & Expert Users | 4 | 02-09-2009 01:50 PM |
| df and bdf discrepencies | sam_pointer | HP-UX | 2 | 10-29-2001 09:58 AM |
| BDF test for > 90% | svp4444 | UNIX for Dummies Questions & Answers | 6 | 09-05-2001 11:49 AM |
|
|