HI, can someone help with this
I would like to have a logic in shell script something like below. Could you provide a sample script
1. Will read a comma separated string which contains remote server list server1, server2, server3,server4. (store it in a variable)
2. Need to execute a shell script on remote server in async (sort of fire and forget). Remote script execution might take 15 minutes to complete. (So guess need FOR loop with execute SSH user@servern “remote_file.sh” & in background mode?)
3. Capture the PID to a variable for each remote execution.
4. Check the status of each PID in frequent internal. ( 10 seconds wait and then re-check)
5. Whichever server/PID finishes, I shouldn’t check the status again for this PID (optional)
6. Wait for a total of 20 minutes or 10 iterations, then exist from this check
7. And report success or failure status.
What I’m trying to achieve is, to minimize the total task execution time
So far I’ve tried like this. But I’m sure there is better way to handle it very