From: FSF BOFH Date: Mon, 22 Aug 2011 20:08:40 +0000 (-0400) Subject: Take backup destination as an argument X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=de80ca1013f45886ee60ad3203598f9c79633bf5;p=wizbackup.git Take backup destination as an argument --- diff --git a/wizbackup-driver b/wizbackup-driver index 1709284..1a5d0bc 100755 --- a/wizbackup-driver +++ b/wizbackup-driver @@ -17,9 +17,9 @@ # along with this program. If not, see . # -if [ $# -lt 1 ] +if [ $# -lt 2 ] then - echo "Usage: $0 [MACHINE-TAB]" + echo "Usage: $0 [MACHINE-TAB] [DEST]" echo echo "The MACHINE-TAB file contains hostnames of machines to be backed up, one per line." echo "Empty lines and lines starting with '#' are ignored." @@ -27,12 +27,12 @@ then fi HOSTS=`cat $1 | egrep -v '^#|^ *$'` +DEST="$2" LOGGROUP=`basename $1` LOGDIR=/var/log/wizbackup LOCKDIR=/var/lock/wizbackup -DEST=/backup -EXCLUDES_DIR=$DEST/EXCLUDE +EXCLUDES_DIR="$DEST/EXCLUDE" today=`date +"%Y%m%d"` mkdir -p $LOGDIR