Hello Forum
I would like your advise on how to manage below logic.
I have to collect crontabs from list of servers.
Most are running well.
For some of them, ssh execution hangs forever.
What I would like to do is to start function ssh_ on background and if it does
not create expected file or still on afteer 15 sec, I want to kill it and go
forward.
Codding looks like:
function ssh_
{
rm -f ssh_end_flag
ssh user1 host1 <<! > host1.out
crontab -l
!
touch ssh_end_flag
}
#MAIN
while read USER HOST
do
ssh_ USER HOST
#... some logic
done < host.file
My idea is to call ssh_ on background.
Meanwhile I should check if ssh_ is still on for later then 15 sec. or if it's
done already and file output have size > 0.
I don't know how to identify as a process and kill ssh_ execution function.
Please help.
Thank you,
Gene
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users