#!/bin/sh
# UL 11/19/15
# Find gateways that requred a commit and execute it.
#/hosting/scripts/run_checkengine.sh
# Available list:
#  forums
#  notify
#  notify-email
#  channels
#  content
#  collaboration-statistics
#  personalization
#  portal
#  metadata
#  process-design
#  process-analytics0
#  process-analytics1
#  process-analytics2
#  process-analytics3
#  process-analytics4
#  process-analytics5
#  process-analytics6
#  process-analytics7
#  process-analytics8
#  process-analytics9
#  process-analytics10
#  process-analytics11
#  process-execution0
#  process-execution1
#  process-execution2
#  process-execution3
#  process-execution4
#  process-execution5
#  process-execution6
#  process-execution7
#  process-execution8
#  process-execution9
#  process-execution10
#  process-execution11

/hosting/products/appian/server/_scripts/diagnostic/checkengine.sh >/hosting/logs/AppianEngineStatus/output.dat

for i in $(perl -lane 'print $F[0] if /Checkpointing/' /hosting/logs/AppianEngineStatus/output.dat) ; do
case $i in
Process-Exec00) echo checkpoint-suite.sh process-execution0;
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-execution0;
sleep 20
;;
Process-Exec01) echo checkpoint-suite.sh process-execution1;
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-execution1;
sleep 20
;;
Process-Exec02) echo checkpoint-suite.sh process-execution2;
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-execution2;
sleep 20
;;
Process-Exec03) echo checkpoint-suite.sh process-execution3;
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-execution3;
sleep 20
;;
Process-Exec04) echo checkoint-suite.sh process-execution4;
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-execution4;
sleep 20
;;
Process-Exec05) echo checkpoint-suite.sh process-execution5;
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-execution5;
sleep 20
;;
Process-Exec06) echo checkpoint-suite.sh process-execution6;
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-execution6;
sleep 20
;;
Process-Exec07) echo checkpoint-suite.sh process-execution7;
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-execution7;
sleep 20
;;
Process-Exec08) echo checkpoint-suite.sh process-execution8;
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-execution8;
sleep 20
;;
Process-Exec09) echo checkpoint-suite.sh process-execution9;
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-execution9;
sleep 20
;;
Process-Exec10) echo checkpoint-suite.sh process-execution010;
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-execution10;
sleep 20
;;
Process-Exec11) echo checkpoint-suite.sh process-execution011;
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-execution11;
sleep 20
;;
Process-Analytics0000) echo checkpoint-suite.sh process-analytics0
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-analytics0
sleep 20
;;
Process-Analytics0001) echo checkpoint-suite.sh process-analytics1
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-analytics1
sleep 20
;;
Process-Analytics0002) echo checkpoint-suite.sh process-analytics2
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-analytics2
sleep 20
;;
Process-Analytics0003) echo checkpoint-suite.sh process-analytics3
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-analytics3
sleep 20
;;
Process-Analytics0004) echo checkpoint-suite.sh process-analytics4
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-analytics4
sleep 20
;;
Process-Analytics0005) echo checkpoint-suite.sh process-analytics5
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-analytics5
sleep 20
;;
Process-Analytics0006) echo checkpoint-suite.sh process-analytics6
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-analytics6
sleep 20
;;
Process-Analytics0007) echo checkpoint-suite.sh process-analytics7
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-analytics7
sleep 20
;;
Process-Analytics0008) echo checkpoint-suite.sh process-analytics8
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-analytics8
sleep 20
;;
Process-Analytics0009) echo checkpoint-suite.sh process-analytics9
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-analytics9
sleep 20
;;
Process-Analytics0010) echo checkpoint-suite.sh process-analytics10
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-analytics10
sleep 20
;;
Process-Analytics0011) echo checkpoint-suite.sh process-analytics11
/hosting/products/appian/server/_scripts/checkpoint-suite.sh process-analytics11
;;
esac
done
