The lock must happen in one atomic step and only the script having the lock must be allowed to write. Not the script which created the locked file.
Did you try the code I offered?
Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery
Improved wording
In reply to Re: Ensure Only One Instance of Your Script is Running... with 'ps -ef' ?
by LanX
in thread Ensure Only One Instance of Your Script is Running... with 'ps -ef' ?
by redapplesonly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |