no more emails for hourly backups, don't run if no task is specified
This commit is contained in:
parent
264656141c
commit
71cd801c19
1 changed files with 14 additions and 3 deletions
|
@ -146,7 +146,8 @@ do_backup() {
|
||||||
verbose "doing database dump: $CMD"
|
verbose "doing database dump: $CMD"
|
||||||
$CMD >> $FILE
|
$CMD >> $FILE
|
||||||
}
|
}
|
||||||
|
#
|
||||||
|
TASK=
|
||||||
#
|
#
|
||||||
# cycle through the command line options
|
# cycle through the command line options
|
||||||
while test $# -ne 0 ; do
|
while test $# -ne 0 ; do
|
||||||
|
@ -179,10 +180,18 @@ while test $# -ne 0 ; do
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
#
|
||||||
|
# we must have *some* task specified
|
||||||
|
if [[ $TASK == '' ]] ; then
|
||||||
|
message "No TASK specified! Pick --hourly, --daily, --weekly, --monthly, --yearly..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# create the blank email report
|
# create the blank email report
|
||||||
create_tmp_email
|
if ! [[ $TASK == 'HOURLY' ]] ; then
|
||||||
|
create_tmp_email
|
||||||
|
fi
|
||||||
#
|
#
|
||||||
if test -f $MAIN_DIR/$BU_CONF ; then
|
if test -f $MAIN_DIR/$BU_CONF ; then
|
||||||
verbose "Reading default in $MAIN_DIR/$BU_CONF"
|
verbose "Reading default in $MAIN_DIR/$BU_CONF"
|
||||||
|
@ -227,5 +236,7 @@ cd $OLD_DIR
|
||||||
#
|
#
|
||||||
# sent resulting email report
|
# sent resulting email report
|
||||||
#
|
#
|
||||||
send_email_report $TASK
|
if ! [[ $TASK == 'HOURLY' ]] ; then
|
||||||
|
send_email_report $TASK
|
||||||
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in a new issue