how to use bash to check .pl is running or not?

if pgrep monitor.pl
then
echo "[`date`] :  Process is already running"
else
echo "[`date`] :  Process is stopped"
perl monitor.pl
fi

What’s to method to check the running status of a perl script?


Source: bash

Leave a Reply