ambevar-dotfiles/.local/bin/rcopy

21 lines
535 B
Plaintext
Raw Normal View History

2015-07-28 14:29:14 +02:00
#!/bin/sh
usage () {
cat <<EOF>&2
2015-07-28 14:29:14 +02:00
Usage: ${0##*/} SOURCE... DEST
Use rsync to copy SOURCE to DEST while showing progress and allowing resuming.
SOURCE can be multiple files or folder. A trailing slash in a source folder will
copy the content of it, not the folder itself. If DEST does not exist, it will
be created. If DEST has files not present in SOURCE, they will remain untouched.
EOF
}
2015-07-28 14:29:14 +02:00
[ $# -lt 2 ] && usage && exit 1
[ "$1" = "-h" ] && usage && exit
[ "$1" = "--" ] && shift
2015-07-28 14:29:14 +02:00
rsync -livr --append-verify --progress -- "$@"