Quote:
You have to explain how these files arrive? What process assigns the file name? and what process removes the files from the directory.
How large are these files?
From destination server these files landing into my environment directory.
Through shell script assign the files to our landing directory, so every 5 mins the files keep on coming to our landing directory and from their it fly to different server within frame of time.
Once its landed ,it moved to different server.
Each file size is almost 256KB.
My requirement is i need to catch last 3 files and perform for loop of my script echo values and exit.
And if it doesn't able to find then every 10 secs it shud check for the files.
Once found perform rest of the logic and make flag change and script successful exit.
So my requirement is now,
Check the directory for file exists.
If found do for loop logic
Else
Sleep for few secs
And again check for files keep on looping
For certain no of count say 20 count each iterate after every 10secs of sleep.
If within this count not found script should exit successfully.