summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBhuvanesh Kumar <bhuvibhuvanesh@gmail.com>2016-02-03 21:38:17 +0530
committerBhuvanesh Kumar <bhuvibhuvanesh@gmail.com>2016-02-03 21:38:17 +0530
commita8504cbf4cfee7978b57277ff0c1f8735d27c16d (patch)
treed574d3c77970864fab151726c0a4fadb9007825b
parent6e27f773161bdf62979f3833138b0792634c6162 (diff)
modified to not assume destination if not provided
-rwxr-xr-xrsync_tmbackup.sh12
1 files 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) <source> [[[user@host:]destination] exclude-pattern-file]"
+ fn_log_info "Usage : $(basename $0) <source> <[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