From de4ef1c56c6db776f9e576ad22606da434e8d243 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Tue, 23 Feb 2021 11:08:26 +0100 Subject: Added cacharle-sync bin, Removed redudant sym link in bin and fixed install script to not recreate it --- bin/bin | 1 - bin/cacharle-sync | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) delete mode 120000 bin/bin create mode 100755 bin/cacharle-sync (limited to 'bin') diff --git a/bin/bin b/bin/bin deleted file mode 120000 index 4f8476b..0000000 --- a/bin/bin +++ /dev/null @@ -1 +0,0 @@ -/home/charles/git/dotfiles/bin \ No newline at end of file diff --git a/bin/cacharle-sync b/bin/cacharle-sync new file mode 100755 index 0000000..9a73f50 --- /dev/null +++ b/bin/cacharle-sync @@ -0,0 +1,27 @@ +#!/usr/bin/env sh + +usage() { + echo "Usage: $0 push/pull [rsync args]" +} + +[ -z "$1" ] || [ $# -gt 2 ] && usage && exit 1 + +RSYNC_CMD="rsync -avh --progress --compress $2" + +REMOTE_USER=charles +REMOTE_HOST=cacharle.xyz + +SYNC_DIR="cacharle-sync/" +SYNC_PATH="$HOME/$SYNC_DIR" + +case "$1" in + push) + $RSYNC_CMD "$SYNC_PATH" "$REMOTE_USER@$REMOTE_HOST:$SYNC_DIR" + ;; + pull) + $RSYNC_CMD "$REMOTE_USER@$REMOTE_HOST:$SYNC_DIR" "$SYNC_PATH" + ;; + *) + usage && exit 1 + ;; +esac -- cgit