The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > AIX
.
google unix.com



AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Monitor directory and email dhawalkv UNIX for Dummies Questions & Answers 6 07-06-2009 07:03 AM
Monitor capacity of directory LRoberts Shell Programming and Scripting 1 06-01-2009 11:58 AM
Monitor file changed / created events on big FS magics HP-UX 0 05-26-2009 07:50 AM
script to monitor directory nulinux Shell Programming and Scripting 17 08-22-2008 10:28 AM
Hep with script to monitor directory cmf00186 UNIX for Dummies Questions & Answers 2 10-25-2006 02:42 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-02-2009
pbillast pbillast is offline
Registered User
  
 

Join Date: Jun 2009
Location: Belgium, Mechelen
Posts: 15
monitor directory events

I'm am looking for a cheap way to trigger a script when a new file is written in a specific directory. AIX 5.3. It is a production system, so no kernel patching (i.e. inotify).
Filemon and audtiing are too expensive.
Thanks in advance.
  #2 (permalink)  
Old 07-02-2009
funksen funksen is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Location: Austria/Vienna
Posts: 430
cronjob checks for the file, if it's there run a script

cronscript.sh:
Code:
if [ -f /yourfile ]
then
yourscript.sh
fi
crontab -e

Code:
* * * * * /cronscript.sh >/dev/null 2>&1
to look for new files in a directory::

something like

Code:
find /directory -cmin -1 -type f -exec /yourscript.sh {}\;
in your script use the $1 variable and do something with the file
Edit:

forgot to say, when using ctime, a file will be processed again when it's modified too, so you should move them elsewhere after first procesing

Last edited by funksen; 07-02-2009 at 04:03 AM..
  #3 (permalink)  
Old 07-02-2009
pbillast pbillast is offline
Registered User
  
 

Join Date: Jun 2009
Location: Belgium, Mechelen
Posts: 15
thanks but I was looking for something that traps the events instead of checking via cron
Reply

Bookmarks

Tags
directory events trigger

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:43 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0