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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #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 05:03 AM..