diff --git a/alias/acl b/alias/acl index 000ace8..5cad5c8 100644 --- a/alias/acl +++ b/alias/acl @@ -1 +1 @@ -alias aud="acluserdir" \ No newline at end of file +alias aud="acladduserdir" \ No newline at end of file diff --git a/function/rsync b/function/rsync index f110fae..f4dc501 100755 --- a/function/rsync +++ b/function/rsync @@ -3,11 +3,14 @@ # present working directory to supplied destination module_load confirm function cprs () { + local usesudo + local cmd + [[ $1 == "-s" ]] && usesudo='sudo' && shift [ $# -ne 2 ] && echo two directories source and destination need to be passed && return 1 [ ! -d "$1" ] && echo source: $1 is not a directory && return 1 - [ ! -d "$2" ] && echo destination: $2 is not a directory && return 1 - echo Command to run: rsync --progress -a -r -u "$1" "$2" + cmd="$usesudo rsync --exclude *[C]ache* --exclude node_modules --progress -aAru $1 $2" + echo $cmd confirm Do you want to start the rsync copy? || return 0 echo copying..... - rsync --exclude *[C]ache* --progress -a -r -u "$1" "$2" + eval $cmd }