How to track the modification history on file in unix


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to track the modification history on file in unix
# 1  
Old 03-27-2008
How to track the modification history on file in unix

How do we track the modification history on a file in UNIX. IS there any command or any script that we could run.

Many Thanks
# 2  
Old 03-27-2008
probably the stat command will work, also look at the man pages of find.
Example with stat :
Quote:
[user@host ~]$ stat rand.pl
File: `rand.pl'
Size: 260 Blocks: 8 IO Block: 4096 regular file
Device: 803h/2051d Inode: 14110218 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 500/user) Gid: ( 500/user)
Access: 2008-03-27 12:21:54.000000000 +0200
Modify: 2008-02-15 12:09:06.000000000 +0200
Change: 2008-02-15 12:09:06.000000000 +0200
I edit the file with vi, add one line/character, and then the Modify field becomes :
Modify: 2008-03-27 14:10:53.000000000 +0200
# 3  
Old 03-27-2008
The question could also be interpreted to mean what was changed, not just when. Basically the solution to that is revision control.
# 4  
Old 03-28-2008
i am not basically looking for any change in the content of the file, just want know whether i can track who n all have modified the file and time they had modified
# 5  
Old 03-28-2008
somehow stat is not giving me satisfactory results.,
here 's what i have done,

vi a test file

add some content
then,
-bash-3.00$ stat test.pl
File: `test.pl'
Size: 54 Blocks: 8 IO Block: 8192 regular file
Device: 1fh/31d Inode: 33573536 Links: 1
Access: (0644/-rw-r--r--) Uid: (19914/arvindgk) Gid: (11063/ qe)
Access: 2008-03-28 00:57:42.000000000 -0400
Modify: 2008-03-28 00:57:42.000000000 -0400
Change: 2008-03-28 00:57:42.000000000 -0400

---
then again vi the file, modify it

-bash-3.00$ stat test.pl
File: `test.pl'
Size: 69 Blocks: 8 IO Block: 8192 regular file
Device: 1fh/31d Inode: 33573532 Links: 1
Access: (0644/-rw-r--r--) Uid: (19914/arvindgk) Gid: (11063/ qe)
Access: 2008-03-28 00:58:23.000000000 -0400
Modify: 2008-03-28 00:58:23.000000000 -0400
Change: 2008-03-28 00:58:23.000000000 -0400


--- do not know wots happening here, it has the access, modify and change times are updated.

** wot i am looking for is i want both the time to be displayed, so that i can track who all had accessed or modified the file

Many thanks
# 6  
Old 03-28-2008
The inode changed there so you really have a new file there, under the hood. Some editors work like that, for various reasons.

For tracking system-wide when a named file has changed, with history, you need to install some additional software which monitors the file system for you; the desired functionality is not available by default. If you are on a HAL system (try man hald) then I think it may offer something like this, possibly as an add-on.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

The Great History of UNIX (1969-1999) | 30 Years of UNIX History | YouTube Video

I am pleased to announce this new video in 1080 HD for UNIX lovers honoring thirty years of UNIX history spanning from 1969 to 1999 presented in 150 seconds (two and a half minutes) in 1080 HD, celebrating the 50th anniversary of UNIX. The Great History of UNIX (1969-1999) | 30 Years of UNIX... (8 Replies)
Discussion started by: Neo
8 Replies

2. Shell Programming and Scripting

History file in UNIX

commands to view the history file in unix. I am not sure whether it is bash_history.sh (1 Reply)
Discussion started by: ramkumar15
1 Replies

3. Shell Programming and Scripting

UNIX CO command for file version history

Hello :) I'm a newb when it comes to shell scripting and was wondering about a command(s) for a script that could be used to checkout a certain number of version/revision histories of a file. I know for the latest revison you "co filename" or for a certain revision number "co -r*.* filename"... (2 Replies)
Discussion started by: MN-DBA
2 Replies

4. UNIX for Dummies Questions & Answers

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (1 Reply)
Discussion started by: sriky86
1 Replies

5. UNIX for Advanced & Expert Users

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (3 Replies)
Discussion started by: linuxadmin
3 Replies

6. Solaris

Command for checking modification history on file

What is the command for checking modification history on file? ---------- Post updated at 01:20 PM ---------- Previous update was at 12:35 PM ---------- Let me rephrase this. On a regular Unix file can I at least check to see the time and date history modification of the file? (6 Replies)
Discussion started by: jastanle84
6 Replies

7. Shell Programming and Scripting

To track any modification in a specfic file

Hi All, I am a pretty new to programming or scripting. Please help me in my below query. I want to write a script which can track a file for any kind of modification and if there is any modification then it should move that file or i should say backup that file to another server. Please... (6 Replies)
Discussion started by: makkar4u
6 Replies

8. Shell Programming and Scripting

File modification history

Can anyone please suggest an alternate command for "stat" . I am trying this on Solaris 5.9 , but the command doesn't exist. Basically i need to see one particalar file modification history. Any help is appreciated. (4 Replies)
Discussion started by: mk1216
4 Replies

9. Solaris

Modification history for Crontab

Hi all - I've searched the forums and seen a few questions related, but nothing which explicitly answers what I'm looking for. I need to know if there's ANY way to get the modification history of any users crontab. Yes, I know that crontabs are in /var/spool/cron. I know that the... (2 Replies)
Discussion started by: amcq
2 Replies

10. UNIX for Dummies Questions & Answers

Possible to track FTP user last login? Last and Finger don't track them.

Like the topic says, does anyone know if it is possible to check to see when an FTP only user has logged in? Because the shell is /bin/false and they are only using FTP to access the system doing a "finger" or "last" it says they have never logged in. Is there a way to see when ftp users log in... (1 Reply)
Discussion started by: LordJezo
1 Replies
Login or Register to Ask a Question