March 28th, 2012, 06:02 PM
Help required - Urgent - How to code WaitforFile in Use
I have a Production Install day after tomorrow and I am in a critical issue.
I have a LINUX Wrapper Script which is being called 3 times ( from Autosys job) at the same time. This script generates a Parameter file with the same name.The script is trying to create/overrite the same parameter file 3 times & due to this, the ETL process which is trying to read this parameter file is fetching incorrect values.
Is there a way we can specify in the script that
1) If the Parameter file is in use by the Wrapper through the first instance,wait until it is read/write before the 2nd instance start accessing.
I know I need to make some major code changes, but due to the time constraints, I am looking for a workaround.
Any thoughts will be of great help.
March 29th, 2012, 06:06 AM
A quick and dirty way would be to use/test a flag file:
while [ -f /tmp/ETL_in_use ]
# do work
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc