Results 1 to 2 of 2
Hi all,
I create following bash script part to check open files on my remote server.
Code:
ssh -T $S_LOGIN <<EOI
open_File=`lsof +D /x01/files/scripts/ |grep -v "DIR"|wc -l`
echo "open ...
- 12-12-2011 #1Just Joined!
- Join Date
- Nov 2010
- Posts
- 23
check open file using lsof
Hi all,
I create following bash script part to check open files on my remote server.
but here wc -l value not assign to $open_File variable it print as 0 (There are some open files in serverCode:ssh -T $S_LOGIN <<EOI open_File=`lsof +D /x01/files/scripts/ |grep -v "DIR"|wc -l` echo "open file count : \$open_File" if ["$Open_File" -gt 1]; then echo "Warning:Folder have following open files" lsof +D /x01/files/scripts |grep -v "DIR" else echo "No Open files "; fi exit; EOI
). please give some help for this or please give some proper way to check open files.
Last edited by charith; 12-12-2011 at 04:34 PM. Reason: update
- 12-13-2011 #2
$Open_File and $open_File are not the same variable
linux user # 503963


Reply With Quote