test rsync copying (Again)
This commit is contained in:
@@ -23,6 +23,7 @@ Paste files using clipboard:
|
||||
-l Use hardlink instead of file copying
|
||||
-k Keep clipboard link
|
||||
-m Move instead of copy (can not be used with any other switch)
|
||||
-r Use rsync to copy (verbose progress)
|
||||
Shortcut to switches example: ${HL}$SELF plk${NO} equals -l and -k
|
||||
|
||||
Delete source files using clipboard links (WARNING):
|
||||
@@ -202,6 +203,7 @@ _paste() {
|
||||
if [[ "$1" =~ l ]]; then hardlink=1; fi
|
||||
if [[ "$1" =~ k ]]; then keeplink=1; fi
|
||||
if [[ "$1" =~ m ]]; then movelink=1; fi
|
||||
if [[ "$1" =~ r ]]; then usersync=1; fi
|
||||
# parse switches
|
||||
for (( i=2; i<=$#; i++ )); do
|
||||
case ${!i} in
|
||||
@@ -209,6 +211,7 @@ _paste() {
|
||||
-l) hardlink=1; ;;
|
||||
-k) keeplink=1; ;;
|
||||
-m) movelink=1; ;;
|
||||
-r) usersync=1; ;;
|
||||
*)
|
||||
if [[ ! -f "$STORAGE/${!i}" ]]; then
|
||||
# no such clipboard
|
||||
@@ -318,6 +321,11 @@ _paste_single() {
|
||||
return $?
|
||||
fi
|
||||
|
||||
if [[ "$usersync" = 1 ]]; then
|
||||
echo rsync "${1} -> ${OUTPUT}/$target"
|
||||
rsync -ElhprtvxP --info=progress2 --no-i-r "${1}" "${OUTPUT}/$target"
|
||||
return $?
|
||||
fi
|
||||
echo Copying "${1} -> ${OUTPUT}/$target"
|
||||
if [[ -f "${1}" ]]; then
|
||||
if [[ $( stat -c "%s" "$1" ) -gt 100000000 ]]; then
|
||||
|
||||
Reference in New Issue
Block a user