LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-15-2009, 08:38 PM   #1
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,261
Blog Entries: 11

Rep: Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242
How can you monitor specific file accesses?


Hi everyone,

This is not a Slackware specific issue, but all my tools are Slackware and Slackers have the best answers... so...

I am working on a web server, CentOS/Apache/PHP, huge directory depth. Every couple of days a particular PHP file gets modified - no one is sure how.

I have convinced myself that it is not happening by human action (i.e. not from the shell, at least by this account, or FTP). I personally have only two data points for the time it is happening and they are within minutes of each other on two different days. There are no cron jobs listed in the cpanel, but cron -l does show one process that runs every 20 minutes. I have checked it and do not think it is the culprit - but will disable it for testing anyway.

My main question: Is there an easy way to reliably monitor a specific file to find out which process is writing to it. fuser might be useful, but it would be difficult I think to snag such a quick, one-time event with it.

I am looking for the bit of knowledge that should be in my brain cell, but isn't for some reason

Thanks
 
Old 07-15-2009, 09:05 PM   #2
AsusDave
Member
 
Registered: Jul 2008
Distribution: Debian, Ubuntu 10.04
Posts: 151

Rep: Reputation: 34
I'm not a slacker, (at least not in the Slackware way) :-) but what about inotify? It looks like it would do what you want, allowing monitoring of a single file or directory.

HTH
Dave
 
Old 07-15-2009, 09:22 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,261

Original Poster
Blog Entries: 11

Rep: Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242
Thanks Dave - looks promising, I am reading up now - found this article at IBM:

http://www.ibm.com/developerworks/op...l-inotify.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
logging file accesses on a shared computer cryo70 Linux - General 5 10-16-2005 10:58 AM
Specific Monitor Refresh Rates in Redhat? dbeatle123 Linux - Hardware 3 01-13-2005 12:22 PM
Opening new windows in specific monitor Vie Linux - Newbie 3 08-19-2004 06:59 AM
Howto monitor network trafic on specific port MDanger Linux - Networking 2 03-31-2004 02:45 PM
Statistics on file accesses (Samba) ? intens Linux - Software 5 01-19-2004 11:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration