- Note: Handle by assuming non-paths are option args
# 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;
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";