Finding the list of users who modified a file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Finding the list of users who modified a file
# 1  
Old 10-19-2010
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 for possible modification at the end of day (every day) and list out those users who modified the files under it.

Appriciate Your suggestion on this .

Thanks
Mahapatra
# 2  
Old 10-19-2010
You'll need some kind of audit for this. Whatever your OS is, check if there is an auditing tool/suite available.
# 3  
Old 10-19-2010
kindly let me know the operating system u r using..
u can write a script wherein u can list the files and get the user who have modified.
the code goes something like this!
ls -lrt | awk '{print $4}'
# 4  
Old 10-19-2010
Thanks Zaxxon - I have no idea on any audit tool.

I thought the sudoers file might have this kind of information and a sysadmin will be able to tell all these info.
But i was told the same thing what you suggest( a audit script) - I am not able to relate -
How to find who change the file , i know i can find when the file was last changed but not the other.

Any thought ?

Thanks again
Jambesh

---------- Post updated at 04:23 PM ---------- Previous update was at 04:18 PM ----------

Thanks Vkca ,

However this will not help. ls -ltr | awk {prin $4 }' will give the file owner name and not the real user who edit this .

Let say one file a.x which is owned by unix-admin and has write access to group and that group has 50 users.

Now who whever change the files from the 50 users your command will always list the owner and not the real user.
Hope you got what i am looking for.

Thanks
Jam
# 5  
Old 10-19-2010
Hi.

Many wikis keep file transactions in a source-control scheme. The simplest and fastest way to set up an auditing facility for a small number of files might be to find a wiki that suits you, say from List of wikis - Wikipedia, the free encyclopedia (or from your own repository), install it, create your file(s), and let your users have at it. (Many details omitted for the sake of brevity.)

Good luck ... cheers, drl
# 6  
Old 10-20-2010
As said, it is dependent what Operating System you are using, in other words: What kind of Unix or Linux distribution you are using dictates what kind of auditing software is available to you.
As a start you could simply google for the name of your OS and the string "auditing". I've found following articles for Linux for example:

Linux system auditing by example
Linux.com :: Detect insider threats with Linux auditing
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Finding the modified timestamp of files from the piped output of du command

Version Info +++++++++++++++ RHEL 5.4 Since ls command lists file sizes in Bytes which can be long I use du command like below. I have run the du command for the below files as shown below. But I want pipe this output to ls command just to see the modified timestamp for these files. ... (7 Replies)
Discussion started by: kraljic
7 Replies

2. Shell Programming and Scripting

Help with finding the latest modified version of a file within directories

I am trying to look into multiple directories and pluck out the latest version of a specific file, regardless of where it sits within the directory structure. Ex: The file is a .xls file and could have a depth within the directory of anywhere from 1-5 Working directory - Folder1... (6 Replies)
Discussion started by: co21ss
6 Replies

3. UNIX for Advanced & Expert Users

Finding the modified date time of a file

Hi, I am new bie to Unix. Might be a simple question I am asking. I want to find the last modified time of a file and find the difference between the currrent time and the last modified time. Appreciate, if someone can throw some light on what commands can be used. Cheers, James (2 Replies)
Discussion started by: JamesJoe
2 Replies

4. Shell Programming and Scripting

finding the file which is modified within last 2 hours

hi, I want to find a file which is modified within last 2 hours i am using sun-os i tried find . -name <filename> -mmin 120 i found that mmin option is not supported in sun-os is there any other alternative option suggestions welcome thanks in advance (5 Replies)
Discussion started by: trichyselva
5 Replies

5. Shell Programming and Scripting

Finding modified File List after the chosen date in Korne Shell...

I am trying to write a Korne Shell asking the user for a date and a directory and then search recursively in this directory the list of files modified after the date chosen. But I am not getting good results when I Test it... #!/usr/bin/ksh echo "Enter a date (YYYYMMDD) " read date touch -t... (2 Replies)
Discussion started by: marconi
2 Replies

6. Shell Programming and Scripting

Finding files which are modified few mins ago

Hi All, I have a requirement to find out the files which are modified in the last 10 minutes. I tried the find command with -amin and -mmin options, but its not working on my AIX server. Can anyone of you could help me. Thanks in advance for your help. Raju (3 Replies)
Discussion started by: rajus19
3 Replies

7. UNIX for Dummies Questions & Answers

how to retrieve original contents of a modified file (modified using vi)

Made changes to a file using vi editor and saved those changes now realised that the changes are not required How can I get the previous version of the file.i.e the one which was there on which I had made changes (3 Replies)
Discussion started by: novice100
3 Replies

8. Solaris

Finding list of modified files for a particular time duration

Hi , I am trying to find out the List of files modified or added aftter installation of any component on SUN solaris box . But i am not able to do it using ls or find command . Can somebody help me out ? Thanks Sanjay Gupta (2 Replies)
Discussion started by: sanajyg_mnit
2 Replies

9. Shell Programming and Scripting

Finding out the last modified time for files

I need to find out the last modified time for the files which are older than 6 months. If I use ls -l, the files which are older than 6 months, I am just getting the day, month and year instead of exact time. I am using Korn shell, and SUN OS. Thanks in Advance, Kiran (3 Replies)
Discussion started by: kumariak
3 Replies

10. UNIX for Dummies Questions & Answers

Finding modified files

Last week I was using the command: ' find /directory -mtime -2 -print' and it showed all the files modified within that period. However, now it only displays the directories and not the files modified. The only thing that changed is that I was granted access to some files. Thanks (2 Replies)
Discussion started by: rhayabusa
2 Replies
Login or Register to Ask a Question