From: Alexander Barton Date: Mon, 3 Aug 2015 14:37:13 +0000 (+0200) Subject: Implement "--outdir|-d" option X-Git-Url: https://arthur.barton.de/gitweb/?p=MkMySqlDump.git;a=commitdiff_plain;h=28f6cef2aff1b9a29c24303265c73663c3806f8f Implement "--outdir|-d" option --- diff --git a/bin/mkmysqldump b/bin/mkmysqldump index 64df841..8489f2e 100755 --- a/bin/mkmysqldump +++ b/bin/mkmysqldump @@ -24,6 +24,8 @@ Help() { echo " MySQL server password [\"$MYPW\"]". echo " --outfile|-o " echo " Path and name of SQL dump file [\"$OUTFILE\"]." + echo " --outdir|-d " + echo " Directory for automatically named dump files." echo " --summary|-s" echo " Display file and file system status summary." echo @@ -63,6 +65,11 @@ while [ $# -gt 0 ]; do OUTFILE="$2" shift 2 ;; + "--outdir"|"-d") + [ $# -ge 2 ] || Usage + OUTFILE="$2/$(hostname -s)-$(date "+%Y%m%d-%H%M%S").sql" + shift 2 + ;; "--summary"|"-s") STATS=1 shift