How to make a script to run everytime a new file is copied into a directory??

Hi folks

I have a unix script script1 in a directory folder1 and also I have few input log files in this directory. My input log files will be copied into this directory folder1 from the portable thumb drive.

Now what I want is I need to run this script1 whenever any new file is copied into this directory and also in a generic way whenever the contents(files) in this folder1 directory changes.

It may look like I can do this with some cron job set to some time intervals everyday, but it will be simply wasting the CPU resources as most of the times I will be running complex scripts other than this script.
The unix environment I am using is cygwin installed in Windows XP.

Thanks in advance..........

Yes as you said you can do with a slight modification in that.

Invoke a find command in crontab for a specified interval, and invoke the script from there if only the directory content has got changed.

Give the path as that directory only, so CPU resources wont get wasted.
This is one way, other ways are also welcome.

Have you got it ?

GNU find supports the -newer option, so you could do this (pseudo code)

find files with modification time later than reference file
loop over the list
    do whatever you have to do
update reference file

Using this via cron would waste minimal resources if nothing changes.