On 3/15/19 2:35 AM, Simon Proctor wrote:
All looking good so far. what is it you're wanting from this data?
Hi Simon,
Thank you!
What this is for is a backup routine. I am checking for
the highest instance of any jammed running instances of
[xfa]dump. If I find any, I "kill -9" it and walk backwards
until I have them all killed.
Once I am sure there are no long any jammed [xfa]dump's running,
then I cut loose my own instance of [xfa]dump.
This is bash script language.
GetLastDumpPID () {
local Last=$(ps ax | grep "[d]ump " | awk '{print $1}' |
/usr/bin/sort -r | /usr/bin/sed -n '1p')
echo $Last
}
KillJammedDumps () {
local PID="`GetLastDumpPID`"
if [ -z "$PID" ]; then
echo " ... No jammed dumps detected"
else
while [ -n "$PID" ]
do
echo " ... kill jammed dump PID <"$PID">"
kill -9 $PID
PID="`GetLastDumpPID`"
done
fi
echo " "
}
-T