I have a script that conducts some SSH calls and I would like to capture the child info so that I can do a sleep and then a cleanup to make sure they do not stay out there as ghosts.
I was told I could do something like this...
#!/bin/sh
for m = job1, job2, job3
x=1
/lcl/tools/bin/sshPing.pl delphin
x=$?
if [ $x = '0' ]; then
/lcl/bin/ssh delphin "/lcl/apps/Tivoli/omnibus_procedure_scripts/delphin_fire.sh" &
fi
x=1
/lcl/tools/bin/sshPing.pl penribbon
x=$?
if [ $x = '0' ]; then
/lcl/bin/ssh penribbon "/lcl/apps/Tivoli/omnibus_procedure_scripts/penribbon_fire.sh" &
fi
x=1
/lcl/tools/bin/sshPing.pl blackracer
x=$?
if [ $x = '0' ]; then
/lcl/bin/ssh blackracer "/lcl/apps/Tivoli/omnibus_procedure_scripts/blackracer_fire.sh" &
fi
echo jobs
exit
But thats not working. I am not a really good at this yet.
I want to catch the PIDS or whatever I need so that after a sleep of say... 300 I could then tell the script to go kill all the PIDS that were started to make sure they finished.
Could somebody help me out here with it?
Thanks
---------- Post updated at 06:08 AM ---------- Previous update was at 05:05 AM ----------
I just need to find a way to have the script compile a list of all the PIDS created from doing the SSH calls so it can then go through at the end to check that they all ended and if not kill them.
Really need some help here please if anyone can.
Thanks!