ps -ef | grep -e "$SCRIPT_NAME" | grep -v grep | grep -v tail | grep -v less | grep -v $$ | grep -v $PPID >> $PROCESS_LIST
if [[ $? == 0 ]]; then
echo "$date Another $SCRIPT_NAME process is already running" >> $mylogfile
ps -ef | grep -e "$SCRIPT_NAME" | grep -v grep | grep -v tail | grep -v less | grep -v $$ | grep -v $PPID >> $PROCESS_LIST
if [[ $? == 0 ]]; then
echo "$date Another $SCRIPT_NAME process is already running" >> $mylogfile