This repository has been archived on 2022-02-20. You can view files and clone it, but cannot push or open issues/pull-requests.
2020-11-13 10:25:04 -08:00
|
|
|
#!/bin/bash
|
|
|
|
# simple copy using rsync. Preserves everything
|
|
|
|
# present working directory to supplied destination
|
|
|
|
module_load confirm
|
|
|
|
function cprs () {
|
2021-02-18 07:31:28 -08:00
|
|
|
local usesudo
|
|
|
|
local cmd
|
|
|
|
[[ $1 == "-s" ]] && usesudo='sudo' && shift
|
2020-11-13 10:25:04 -08:00
|
|
|
[ $# -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
|
2021-02-18 07:31:28 -08:00
|
|
|
cmd="$usesudo rsync --exclude *[C]ache* --exclude node_modules --progress -aAru $1 $2"
|
|
|
|
echo $cmd
|
2020-11-13 10:25:04 -08:00
|
|
|
confirm Do you want to start the rsync copy? || return 0
|
|
|
|
echo copying.....
|
2021-02-18 07:31:28 -08:00
|
|
|
eval $cmd
|
2020-11-13 10:25:04 -08:00
|
|
|
}
|