Greetings Deployment Gods,
I am trying to run a small bash script to stop a process and take a backup of the existing .jar file in a single deployment process step. The script looks something like the following:
PID=$(pgrep -f AppName)
if [ “$PID” == “” ]
echo “App is not running.”
echo “Attempting to stop the app…”
echo “App stopped”.
#Backup the app
cp app.jar app.jar.bak
It appears to be hitting the ‘kill’ command (successfully stops the app most of the time) but the following echo message doesn’t appear and the backup bit isn’t run either.
Any ideas? Where am I going wrong?