From 1bd7b7be83ba48fbd14595d62e3eddee41e601ad Mon Sep 17 00:00:00 2001 From: Onur Cem Celebi Date: Mon, 14 Mar 2016 16:44:43 +0100 Subject: [PATCH] Ensure backup directory exist --- templates/mysqlbackup.sh.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/mysqlbackup.sh.erb b/templates/mysqlbackup.sh.erb index 4246432..2e476c9 100755 --- a/templates/mysqlbackup.sh.erb +++ b/templates/mysqlbackup.sh.erb @@ -23,6 +23,9 @@ ROTATE=<%= [ Integer(@backuprotate) - 1, 0 ].max %> TMPFILE=`mktemp /tmp/backup.XXXXXX` || exit 1 echo -e "[client]\npassword=$PASS\nuser=$USER" > $TMPFILE +# Ensure backup directory exist. +mkdir -p $DIR + PREFIX=mysql_backup_ <% if @ignore_events %> ADDITIONAL_OPTIONS="--ignore-table=mysql.event"