Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
watch a directory for file changes
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
XenoTerraCide
Veteran
Veteran


Joined: 18 Jan 2004
Posts: 1418
Location: MI, USA

PostPosted: Sun Feb 22, 2009 6:23 am    Post subject: watch a directory for file changes Reply with quote

I need a program that will watch a directory for file changes... it would be great if it could log what application/user/group made those changes.
_________________
I don't hang out here anymore, try asking on http://unix.stackexchange.com/ if you want my help.
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Sun Feb 22, 2009 6:32 am    Post subject: Reply with quote

You might want to take a look at dazuko: http://dazuko.dnsalias.org/wiki/index.php/Main_Page

Dazuko is a kernel patch that allows for notification for file changes. I would recommend patching the kernel yourself instead of using the version in portage. Although dazuko is only the kernel patch, I'm guessing there are examples or utilities that utilize it.

BTW - If you need help patching the kernel, I wrote a howto on how to use dazuko with clamav a while ago:
https://forums.gentoo.org/viewtopic-t-604709.html
Back to top
View user's profile Send private message
XenoTerraCide
Veteran
Veteran


Joined: 18 Jan 2004
Posts: 1418
Location: MI, USA

PostPosted: Sun Feb 22, 2009 7:15 am    Post subject: Reply with quote

hmmm... remind me what dazuko does that inotify doesn't?

EDIT: yeah I ran the whole dazuko clamav thing back in the day... clamav isn't something I need in this case....

at least I hope I haven't managed to find a linux virus.
_________________
I don't hang out here anymore, try asking on http://unix.stackexchange.com/ if you want my help.
Back to top
View user's profile Send private message
Tekeli Li
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2009
Posts: 95

PostPosted: Sun Feb 22, 2009 9:43 am    Post subject: Reply with quote

Wait, what's wrong with fam/gamin? There are even Python bindings...
Back to top
View user's profile Send private message
makism
Tux's lil' helper
Tux's lil' helper


Joined: 24 Oct 2007
Posts: 85

PostPosted: Sun Feb 22, 2009 10:26 am    Post subject: Reply with quote

i think pyinotify is pretty cool. using python bindings is very easy to do your job...
it`s in the portage alright...
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Sun Feb 22, 2009 3:31 pm    Post subject: Reply with quote

XenoTerraCide wrote:
hmmm... remind me what dazuko does that inotify doesn't?
Dazuko is a little more comprehensive than inotify. I believe inotify only works with individual files and can only see file changes, where as dazuko can handle whole directories, and other attributes like file access, etc.

Don't hold me to the above statement however :wink:
Back to top
View user's profile Send private message
XenoTerraCide
Veteran
Veteran


Joined: 18 Jan 2004
Posts: 1418
Location: MI, USA

PostPosted: Sun Feb 22, 2009 4:44 pm    Post subject: Reply with quote

I'm not saying dazuko isn't awesome, but it's probably more work than I need in this case.

hmm.... pyinotify sounds interestings... too bad I don't know more about python, although at this point it does sound like I'm gonna have to write at least part of the tool to do what I need.
_________________
I don't hang out here anymore, try asking on http://unix.stackexchange.com/ if you want my help.
Back to top
View user's profile Send private message
makism
Tux's lil' helper
Tux's lil' helper


Joined: 24 Oct 2007
Posts: 85

PostPosted: Sun Feb 22, 2009 6:53 pm    Post subject: Reply with quote

here is a list of events that pyinotify can handle: http://pyinotify.sourceforge.net/#The_EventsCodes_Class
this is the first time i`ve heard of dazuko and i`m curious about it :p i`ll google it...
Back to top
View user's profile Send private message
M
Guru
Guru


Joined: 12 Dec 2006
Posts: 432

PostPosted: Sun Feb 22, 2009 7:01 pm    Post subject: Reply with quote

And for something simpler just emerge http://inotify-tools.sourceforge.net/ . Command line tools for inotify.
Back to top
View user's profile Send private message
XenoTerraCide
Veteran
Veteran


Joined: 18 Jan 2004
Posts: 1418
Location: MI, USA

PostPosted: Sun Feb 22, 2009 8:33 pm    Post subject: Reply with quote

I just noticed the fam/gamin comment. so thus far will any of these tell me which application is modifying these files...
_________________
I don't hang out here anymore, try asking on http://unix.stackexchange.com/ if you want my help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum