Operating System - HP-UX
1748054 Members
4872 Online
108758 Solutions
New Discussion

Re: check with a script open file(s) of a filesystem

 
SOLVED
Go to solution
support_billa
Valued Contributor

Re: check with a script open file(s) of a filesystem

hello,

 

interesting behaviour between HPUX 11.23 and HPUX 11.31 :

 

fuser show different result, when it is used in a pipe:

 

test:

 

mkdir /tmp/fuser_dir

HPUX 11.31:

fuser -f /tmp/fuser_dir  2>/dev/null | wc -l
result: 0

 

info about /usr/sbin/fuser :
what /usr/sbin/fuser                  
/usr/sbin/fuser:
fuser.c $Date: 2010/01/12 19:01:40 $Revision: r11.31/1 PATCH_11.31 (PHCO_40769)
$Revision: @(#) fuser R11.31_BL2010_0112_2 PATCH_11.31 PHCO_40769

HPUX 11.23:

 

fuser -f /tmp/fuser_dir  2>/dev/null | wc -l
result: 1   # <------  wrong 

what /usr/sbin/fuser                  
/usr/sbin/fuser:
     $Revision: B11.23.0409LR

workaround for 11.23:


fuser -f /tmp/fuser_dir  2>/dev/null | grep -v "^$" | wc -l
   
ok ?

James R. Ferguson
Acclaimed Contributor

Re: check with a script open file(s) of a filesystem


@support_billa wrote:

test : filesystem is read only

fuser : 0.1 sec

lsof    : 74 sec


It would be nice to know what options you used when you ran 'lsof'.

 

Regards!

 

...JRF...

H.Merijn Brand (procura
Honored Contributor

Re: check with a script open file(s) of a filesystem

# time lsof /tmp
:
0.03u 4.76s 0:05.22 91.7%
# time fuser -c /tmp
:
0.00u 0.02s 0:00.02 100.0%
# time lsof /tmp/*
:
0.02u 4.59s 0:04.72 97.6%
# time fuser /tmp/*
:
0.02u 0.67s 0:00.70 98.5%
# time lsof /usr/lib/*
:
0.05u 4.74s 0:05.54 86.4%
# time fuser /usr/lib/*
:
0.01u 0.22s 0:00.25 92.0%
#

 I think I've just proven myself wrong on the speed :)

The output of lsof however is still way more usable. 

Enjoy, Have FUN! H.Merijn
support_billa
Valued Contributor

Re: check with a script open file(s) of a filesystem

hello,

 

@ It would be nice to know what options you used when you ran 'lsof'.

 

i tested "lsof" without options : 1:32 min

"lsof" with "-s +D" : 1:20 min

 

regards