X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/c31dcf60e95c4578f156b6638997fcaf3f41e468..97ff1ce0a12ba1018a81ca873a1e63a2049304cd:/user/rsync_tranches.sh?ds=sidebyside diff --git a/user/rsync_tranches.sh b/user/rsync_tranches.sh index 0456daa..eed19f6 100644 --- a/user/rsync_tranches.sh +++ b/user/rsync_tranches.sh @@ -7,7 +7,7 @@ function rsync_tranches() { # Desc: Runs rsync in parallel across different files size ranges # Example: rsync_tranches -avu --progress --dry-run ./SOURCE/ ./DEST/ # Depends: rsync 3.2.7 - # Version: 0.0.3 + # Version: 0.1.0 local -a rsync_opts=(); local source dest; @@ -20,7 +20,13 @@ function rsync_tranches() { shift; ;; *) - if [ -z "$source" ]; then + ## If not a file or directory, assume option + if [[ ! -f "$1" ]] && [[ ! -d "$1" ]]; then + rsync_opts+=("$1"); + shift; + fi; + ## If valid file or directory, assume source or dest path + if [[ -z "$source" ]]; then source="$1"; else dest="$1";