Can we get the list of users who accessed a file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Can we get the list of users who accessed a file
# 1  
Old 02-22-2006
Can we get the list of users who accessed a file

Hi all,
I will thankful if anybody helps me in finding out the users who accessed any of our files.

Thanks in advance
Chanakya
# 2  
Old 09-17-2007
Error

Quote:
Originally Posted by Chanakya.m
Hi all,
I will thankful if anybody helps me in finding out the users who accessed any of our files.

Thanks in advance
Chanakya
Hey,

I have the same problem now that you had long back.
Did you get any solution(s) for this problem ? If yes, I'll appriciate if you'll share the solution to this problem.

I have also been looking to this problem since past 15 days and losts of research is being done to solve this problem.
As you can look into Qs posted by myself in recent times, under Advanced and Expert Unix forum..in this site only.. with title "inode table location ??"

Please help me, if you can !!

Thanks in advance !!Smilie
# 3  
Old 09-18-2007
Hammer & Screwdriver Hope this will help you

Try This one

------------------------------------------------------------------------

Once again I dun have any *NIX box with me. So why Just giving one logic by which you will get your answer.
-------------------------------------------------------------
#!/bin/bash

## List all the files which one accessed since last 1 min #####
for file_dir in `find <parent-dir> -atime -1`

do
### Find out the PID for that files which one been accessed
pid=`fuser -f $file_dir`

### Find out the owner/user name for that Process
### Replace the $access_user_filed with the filed no from the ps -ef
### command
user=`ps -ef | grep $pid | awk { print $access_user_filed }`
echo " $file_dir access by the $user " >> File_Access_List "
mail -s " File Access List " user@yourdomain.com < File_Access_List
done
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File shows in ls but cannot be accessed

I can do an ls -l CD* and see the following CDTEST userA RW RW R and I an logged on as userA. But if I do an ls -l the file does not appear. If I do a vi CDTEST it tries to create a new file named CDTEST. If I do a mv or rm I get the message no file of name CDTEST found. Any idea what is going on.... (3 Replies)
Discussion started by: LeeT
3 Replies

2. UNIX for Advanced & Expert Users

How to find out last 5 users who have accessed a file?

Hi All, is there any command or script to find out last five users who have accessed a file thanks jcpratap (1 Reply)
Discussion started by: Jcpratap
1 Replies

3. Shell Programming and Scripting

Log to find users who accessed server before

Hi, please provide the steps/commands to find out the user id list who accessed server before i logon same server. Thank you very much ffor all your support. (2 Replies)
Discussion started by: sridhardwh
2 Replies

4. UNIX for Dummies Questions & Answers

Apending a list of users to a file

Hi guys, As part of my UNIx homework, I have created a file named dir_listing, which is based within directories. This file already contains the root directory root_dir. I am now required to append a list of users to dir_listing. i can obtain the list by simply typing users, but how would I... (1 Reply)
Discussion started by: Jimmy_c
1 Replies

5. Shell Programming and Scripting

Finding the list of users who modified a file

Dear all, Need a quick help/suggestion on monitoring a particular directory . We have a deployment directory say (/users/integration/deploy ) under this there are several files which can be edited by a number of users - We need to write a script which will check this deployment directory... (5 Replies)
Discussion started by: jambesh
5 Replies

6. Shell Programming and Scripting

check if file is being accessed by any application

Hello, is there maybe a way to check if a specific file is being accessed at the moment? Example: You will start copying a 10 GB file from A to B, how could I code it so my script actually knows when file B is finished copying? (1 Reply)
Discussion started by: TehOne
1 Replies

7. Shell Programming and Scripting

File Accessed Alarm ??

Hey, I want to ask a simple Question.... How would I be able to come to know that files/directoires in a Parent directory has been accessed (means contents of the file has been just viewed) by the user(s) in a group ? and mail the name(s) of those files/directories which has been accessed... (16 Replies)
Discussion started by: varungupta
16 Replies

8. AIX

File Accessed Alarm ??

Hey, I want to ask a simple Question.... How would I be able to come to know that files/directoires in a Parent directory has been accessed (means contents of the file has been just viewed) by the user(s) in a group ? and mail the name(s) of those files/directories which has been accessed... (1 Reply)
Discussion started by: varungupta
1 Replies

9. Shell Programming and Scripting

how to know which login file is being accessed

when unix is logged in it access some login file depending on the shell like .cshrc , .login , .vimrc , .bashrc how can we know which is being access in a perticular unix flavor. (1 Reply)
Discussion started by: useless79
1 Replies

10. UNIX for Dummies Questions & Answers

list file which is accessed yesterday

how can I use 'ls' to list file which is accessed yesterday? Thx :confused: (2 Replies)
Discussion started by: aaron_fong
2 Replies
Login or Register to Ask a Question