I have a file system called /datafiles. Within this file system I allow remote users to upload files to me with the structure of "upload.0002", "upload.0003", "upload.0004", etc. I want to monitor this directory with a Korn script running at certain times via crontab, that will identify when one of these files exist then run a series of commands on the file that is found. I need to:
1) Be able to identify the file when it is present and has been completely uploaded
2) Discover the files extension (i.e. 0002, 0003, 0004, etc.)
3) Run a series of commands of the file using its extension as an argument.