I have a directory on a Solaris box that has 58 files written to it every 15min. They have a non standard date as part of the file name but always have another name with it. I need to check that directory for files created within the last 15min and then port the results to a log file. There are thousands of files but should only be and up to 58 within the last 15min. Wish there was ls for it but I can't find any. Anyone got a script or knows of a command?
There is a serious lack of detail in this post.
What version of Solaris?
What Shell do you use?
What are the filenames? Any special name for the LAST file to be transferred in a batch of files?
How long does it take to create the "up to 58 files"? Let's hope that it is nowhere near 15 mins?
How often do you need to check?
Why are you doing this?
As posted, this task is impossible to program. However you approach it there is a good chance of hitting a point part-way through a batch of file transfers.
Suggest you consider changing the process such that subsequent processing is feasible. Creating a zero-length "started" file at the start of each batch of files and a zero-length "finished" file at the end of each batch is a good method for delimiting batches with timestamped files.
As for commands, let's see what your environment is and how often you need to check. We shall assume throughout that you are the root user and have full permissions to create cron jobs.