LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-05-2004, 01:25 AM   #1
tek1024
Member
 
Registered: Sep 2003
Posts: 49

Rep: Reputation: 15
file monitoring + take action


I helped a guy out on a problem before and he's come back to me; I don't want to let him down. Here's what he told me he needs:
Quote:
I want to 'grep' /var/log/httpd/access_log and take an action when the word "resume" is seen. That means someone saw my resume, and it'd be cool if it could ring a bell or something.....maybe just email me with the details. Have you seen any way to do that?
The short answer to him, of course, is simply "no, I haven't," but I don't want to let him down. I'm curious myself how to do this.

I looked up File Alteration Monitor (FAM) and DNotify, as well as fileschanged. But these won't help unless I know bash scripting (I don't) or Perl (I don't). I know Java and a bit of 101-level C++, but if there's another solution to this, please let me know.

Any ideas? Thanks!
 
Old 11-05-2004, 02:10 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
kinda depends how often he wants to do this, presumably dependent on what the "action" would be, but i'd say that nothing more than cron and bash is needed...

Code:
resume_count = `grep /var/log/httpd/access_log resume | wc -l`
if [ $resume_count -gt 0 ] then
  echo My resume was read! how cool! | mail -s Resume dave@dave.com
fi
so ***basically*** that in a cron job every few hours... mind you though, this won't stop emailing you if it's already seen it and mailed abuot a particular line... and i'm in XP at the moment, so can't realistically test it.
 
Old 11-18-2004, 03:13 PM   #3
tek1024
Member
 
Registered: Sep 2003
Posts: 49

Original Poster
Rep: Reputation: 15
Just wanted to say thanks for the reply, never did. Have a good one!
 
Old 11-18-2004, 06:41 PM   #4
HeWhoNeverSleep
LQ Newbie
 
Registered: Nov 2004
Location: USA
Distribution: HeWhoNeverSleeps
Posts: 3

Rep: Reputation: 0
tutds
 
  


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
File Monitoring vnbenvn Programming 1 05-24-2005 05:01 AM
bandwidth monitoring file !! hitesh_linux Linux - Software 12 01-26-2005 01:12 PM
Changing the default open action for an executable file nitrambass LinuxQuestions.org Member Intro 1 06-22-2004 03:09 PM
File Monitoring App? embsupafly Linux - Software 2 12-18-2003 01:55 PM
File Monitoring App? embsupafly Linux - Software 1 12-18-2003 11:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:08 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
Open Source Consulting | Domain Registration