LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 07:38 PM   #1
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
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, 08: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, 08:22 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264

Original Poster
Blog Entries: 24

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

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


Reply



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 09:58 AM
Specific Monitor Refresh Rates in Redhat? dbeatle123 Linux - Hardware 3 01-13-2005 11:22 AM
Opening new windows in specific monitor Vie Linux - Newbie 3 08-19-2004 05:59 AM
Howto monitor network trafic on specific port MDanger Linux - Networking 2 03-31-2004 01:45 PM
Statistics on file accesses (Samba) ? intens Linux - Software 5 01-19-2004 10:57 AM

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

All times are GMT -5. The time now is 01:02 AM.

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
Open Source Consulting | Domain Registration