Added -e option

Added -e option by request
Updated process checking method to allow -e option
This commit is contained in:
woogerboy21 2015-07-11 16:35:12 -04:00
parent 10019bf985
commit 9338e7e71f
2 changed files with 4 additions and 4 deletions

View file

@ -1,5 +1,6 @@
#!/bin/bash
set -u
set -e
SLEEPTIME=5
SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file
LOGAPPENDDATE=`date +%m%d%Y`
@ -30,8 +31,7 @@ TABLES=(
)
PROCESSNAME="mysqldump"
COMMANDRESULTS=`ps -e |grep $PROCESSNAME |grep -v grep`
if [ -z "$COMMANDRESULTS" ];
if [ "$(pgrep $PROCESSNAME)" == "" ];
then
[ ! -d $BACKUPDIR ] && mkdir -p $BACKUPDIR/
for TABLENAME in "${TABLES[@]}"

View file

@ -1,5 +1,6 @@
#!/bin/bash
set -u
set -e
SLEEPTIME=5
SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file
LOGAPPENDDATE=`date +%m%d%Y`
@ -30,8 +31,7 @@ TABLES=(
)
PROCESSNAME="mysqldump"
COMMANDRESULTS=`ps -e |grep $PROCESSNAME |grep -v grep`
if [ -z "$COMMANDRESULTS" ];
if [ "$(pgrep $PROCESSNAME)" == "" ];
then
[ ! -d $BACKUPDIR ] && mkdir -p $BACKUPDIR/
for TABLENAME in "${TABLES[@]}"