Change-Id: I973827ec916f65c5f8e7f2317c5b51a30ea88474
mylogfile="$logdir/zfs-replicate-all.log"
date=`date`
starttime=`date +%s`
mylogfile="$logdir/zfs-replicate-all.log"
date=`date`
starttime=`date +%s`
# Make sure we aren't already running
SCRIPT_NAME=${0##*/}
# Make sure we aren't already running
SCRIPT_NAME=${0##*/}
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