shell-base/function/rsync
David Kebler 0ac5906eee refactor the way the module library is loaded
added startup script callable from profile.d
renamed setup.sh to load.sh
added rsync copy function cprs
added shell.env that is called by /etc/profile to set up access to this  and related repos
2020-11-13 10:25:04 -08:00

13 lines
559 B
Bash
Executable file

#!/bin/bash
# simple copy using rsync. Preserves everything
# present working directory to supplied destination
module_load confirm
function cprs () {
[ $# -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"
confirm Do you want to start the rsync copy? || return 0
echo copying.....
rsync --progress -a -r -u "$1" "$2"
}