From a8504cbf4cfee7978b57277ff0c1f8735d27c16d Mon Sep 17 00:00:00 2001 From: Bhuvanesh Kumar Date: Wed, 3 Feb 2016 21:38:17 +0530 Subject: [PATCH] modified to not assume destination if not provided --- rsync_tmbackup.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/rsync_tmbackup.sh b/rsync_tmbackup.sh index a5dd28d..2d67694 100755 --- a/rsync_tmbackup.sh +++ b/rsync_tmbackup.sh @@ -32,7 +32,7 @@ trap 'fn_terminate_script' SIGINT # Small utility functions for reducing code duplication # ----------------------------------------------------------------------------- fn_display_usage() { - fn_log_info "Usage : $(basename $0) [[[user@host:]destination] exclude-pattern-file]" + fn_log_info "Usage : $(basename $0) <[user@host:]destination> [exclude-pattern-file]" } fn_parse_date() { @@ -114,18 +114,12 @@ SSH_CMD="" SSH_FOLDER_PREFIX="" #display usage information if required arguments are not passed -if [[ "${#@}" -lt 1 ]]; then +if [[ "${#@}" -lt 2 ]]; then fn_display_usage exit 1 fi SRC_FOLDER="${1%/}" - -#if destination folder is not specified assume current folder -if [ -z ${2} ]; then - DEST_FOLDER="." -else - DEST_FOLDER="${2%/}" -fi +DEST_FOLDER="${2%/}" EXCLUSION_FILE="$3" fn_parse_ssh