![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX and Linux Applications Questions involving software not covered by other forum go here. This includes Databases and Middleware. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| monitor changes made by root | scriptarg | UNIX for Dummies Questions & Answers | 0 | 07-08-2007 07:42 AM |
| Made command into a script but now won't run | patwa | UNIX for Dummies Questions & Answers | 9 | 06-15-2007 06:28 PM |
| how to find a file named vijay in a directory using find command | amirthraj_12 | UNIX for Dummies Questions & Answers | 5 | 10-25-2006 02:39 PM |
| Can this be made into one single line? | nmsinghe | Shell Programming and Scripting | 6 | 09-20-2002 08:58 AM |
| How do i check if changes were made to a file using vi | TRUEST | Shell Programming and Scripting | 1 | 03-11-2002 06:49 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Is there any way to find any changes made to a directory?
Hi groupies.
Is there any way to find any changes made to a directory? Changes are adding a file to the directory or removing a file. That is, I need to get the name of the file which is added or removed. For adding, I think one way of doing it, is by creating a script to access creation time or modification time frequently. If there are any files with timestamp grater than the “time” previously saved get the file name of it. Will this works….?? or is there any function to trigger...?? |
| Forum Sponsor | ||
|
|
|
|||
|
One possible solution is find(1)'s -(a|c)newer flags. For that you need to know the last file created/accessed. Then use that file to find the latest ones. You could also use a default file, perhaps a hidden file, and use touch(1) to update the access time of this file everytime there's a new file.
Inorder to get the name of a deleted file, you'll prolly have to save the filenames somewhere. And then compare this list with the current filenames in the directory. |