The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
fuser not showing file open by vi JamesByars UNIX for Advanced & Expert Users 4 02-25-2008 10:49 AM
help needed in fuser command anju Shell Programming and Scripting 1 02-19-2008 10:08 PM
fuser adrianlearnpro UNIX for Dummies Questions & Answers 7 03-23-2006 01:31 PM
fuser brought down the box bandaru AIX 5 08-03-2005 05:39 AM
Help with fuser vibhor_agarwali UNIX for Dummies Questions & Answers 11 04-18-2005 11:13 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-31-2007
Registered User
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 187
fuser ?? Look at the script !!

#SCRIPT TO CHECK WHO HAS ACCESSED THE LOG/FILE IN PAST 'N' MINUTES, AND MAIL ACCORDINGLY.

MYPATH="/clocal/mqbrkrs/user/mqsiadm/sanjay/"
MAIL_RECIPIENTS="abc@xyz.com"
Subject="File accessed in last few minutes"
>tempmail.txt
>tempfind.txt

find "$MYPATH" -type f -amin -1 > tempfind.txt
cat tempfind.txt

cat tempfind.txt | \
while read line
do
echo "**$line**"
fuser -uV $line >> tempmail.txt
echo "::"
cat tempmail.txt
echo "::"
done

#cat tempmail.txt | mailx -s "$Subject" $MAIL_RECIPIENTS


In the above script, command fuser is not wroking properly, means for some of the files its showing the process no with user name, but for some its not showing. I am getting output like: (here i have made some check points that print the present value of the tempmail.txt, tempfind.txt and $line)

/clocal/mqbrkrs/user/mqsiadm/sanjay $ AccessMonitor_Script

/clocal/mqbrkrs/user/mqsiadm/sanjay/tempfind.txt
/clocal/mqbrkrs/user/mqsiadm/sanjay/AccessMonitor_Script
/clocal/mqbrkrs/user/mqsiadm/sanjay/tempmail.txt
**/clocal/mqbrkrs/user/mqsiadm/sanjay/tempfind.txt**
/clocal/mqbrkrs/user/mqsiadm/sanjay/tempfind.txt:

::
::
**/clocal/mqbrkrs/user/mqsiadm/sanjay/AccessMonitor_Script**
/clocal/mqbrkrs/user/mqsiadm/sanjay/AccessMonitor_Script:
inode fd=62 (mqsiadm)

::
1015990::
**/clocal/mqbrkrs/user/mqsiadm/sanjay/tempmail.txt**
/clocal/mqbrkrs/user/mqsiadm/sanjay/tempmail.txt:

::
1015990::
/clocal/mqbrkrs/user/mqsiadm/sanjay $



Any Idea on this ???
Please reply ASAP!!
Reply With Quote
Google UNIX.COM
Forum Sponsor
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0