Created
April 17, 2020 22:47
-
-
Save karrick/174dec445aae692c3365b2489f4d59ca to your computer and use it in GitHub Desktop.
overwrite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
remote=some.remote.host | |
OPTIND=1 | |
while getopts :r: option 2>/dev/null | |
do | |
case $option in | |
r) remote="$OPTARG" ;; | |
\:) echo >&2 "fatal: option [$OPTARG] requires an argument\n" ;; | |
\?) echo >&2 "fatal: unknown argument [$OPTARG]\n" ;; | |
esac | |
done | |
shift $(($OPTIND-1)) | |
if [ -z "$remote" ] ; then | |
echo >&2 "usage: $(basename $0) [-r some.remote.host]" | |
exit 2 | |
fi | |
relative="${PWD#$HOME/}/" | |
time rsync -ai --delete --exclude ._DS_Store --exclude build ./ $remote:$relative |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment