From 28f6cef2aff1b9a29c24303265c73663c3806f8f Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Mon, 3 Aug 2015 16:37:13 +0200 Subject: [PATCH] Implement "--outdir|-d" option --- bin/mkmysqldump | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.39.2