summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c31dcf6)
- 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
# Desc: Runs rsync in parallel across different files size ranges
# Example: rsync_tranches -avu --progress --dry-run ./SOURCE/ ./DEST/
# Depends: rsync 3.2.7
local -a rsync_opts=();
local source dest;
local -a rsync_opts=();
local source dest;
- 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";
source="$1";
else
dest="$1";