added no-clobber flag
This commit is contained in:
parent
b6568cf471
commit
b57a34226e
14
icp
14
icp
|
|
@ -3,10 +3,12 @@ usage() {
|
|||
echo >&2 "Usage: $(basename $0) [OPTION] SOURCE... DEST"
|
||||
echo >&2 "Copy like cp, but use rsync in the background."
|
||||
echo >&2 "Options:"
|
||||
echo >&2 " -h print this help message"
|
||||
echo >&2 " -n print rsync command and perform a dry-run"
|
||||
echo >&2 " -r copy directories recursively"
|
||||
echo >&2 " -v verbose output"
|
||||
echo >&2 " -h print this help message"
|
||||
echo >&2 " -L follow symlinks in source"
|
||||
echo >&2 " -n no-clobber, do not overwrite existing files"
|
||||
echo >&2 " -r copy directories recursively"
|
||||
echo >&2 " -v verbose output"
|
||||
echo >&2 " --dry-run print rsync command and perform a dry-run"
|
||||
echo >&2 "Positional arguments:"
|
||||
echo >&2 " SOURCE file/directory to copy"
|
||||
echo >&2 " DEST target directory or filename (if only one SOURCE)"
|
||||
|
|
@ -31,9 +33,13 @@ do
|
|||
elif [[ "$arg" == "-r" ]];then
|
||||
flag_recursive=1
|
||||
rsync_opt+=("-r")
|
||||
elif [[ "$arg" == "-L" ]];then
|
||||
rsync_opt+=("-L")
|
||||
elif [[ "$arg" == "-v" ]];then
|
||||
rsync_opt+=("-v")
|
||||
elif [[ "$arg" == "-n" ]];then
|
||||
rsync_opt+=("--ignore-existing")
|
||||
elif [[ "$arg" == "--dry-run" ]];then
|
||||
flag_dryrun=1
|
||||
rsync_opt+=("-nv")
|
||||
elif [[ -f "$arg" ]];then
|
||||
|
|
|
|||
Loading…
Reference in New Issue