I have 4 shell script to generate a file(let\'s say param.txt) which is used by another tool(informatica) and as the tool is done with processing, it deletes param.txt.
You can use GNU Parallel as a counting semaphore or a mutex, by invoking it as sem
instead of as parallel
. Scroll down to Mutex
on this page.
So, you could use:
sem --id myGlobalId 'create input file; run informatica'
sem --id myGlobalId 'create input file; run informatica'
sem --id myGlobalId 'create input file; run informatica'
sem --id myGlobalId 'create input file; run informatica'
Note I have specified a global id
in case you run the jobs from different terminals or cron. This is not necessary if you are starting all jobs from one terminal.