Help in running a script after a particular time

Unix Gurus,

I have a requirement where the shell script needs to do specific tasks after certain period of time.

Daily we receive few files in a particular folder. The script does the file renaming, pass parameters to run some web services and pushes to remote FTP location.

But my requirement is to run the script 30 mins after the first file arrived. How to check and add that condition?

For example the 10 files start arriving from 10.00 AM. When I run the script it should get the earliest file saved time and do all the tasks 30 minutes later.
Basically it need to keep on checking the condition whether the time is +30mins of the first file saved time.

Note that the folder will always be empty after the script is run and hence there will be no expired time or overlap.

Please help.

Thanks in advance.

What you dont say is how you check the presence of files in that folder...

Actually the script is fired every time a file is arrived. This is done through an external application. This featured cannot be disabled since its used by some other applications too.

So the idea is even though the script is fired every time a file is arrived, I wanted to check if 30 minutes has passed from the first file arrival time and then do the existing logic.

Thanks

If its the same script what will be the point since it is going to process anyway... How will you delay the processing since its launched by a external process. All you can do is write a script that sets a flag with timestamp to let you know the first file arrived, you could at that point also reschedule whatever you want 30 minutess later using at command