From 828d83ea4d3022b64df230195b6cab9eb0a367c1 Mon Sep 17 00:00:00 2001 From: Shun Git Date: Sun, 3 Oct 2021 22:19:01 +0800 Subject: [PATCH] add rclone --- bin/rcsync | 18 ++++++++++++++++++ rclonefilter | 3 +++ 2 files changed, 21 insertions(+) create mode 100755 bin/rcsync create mode 100644 rclonefilter diff --git a/bin/rcsync b/bin/rcsync new file mode 100755 index 0000000..5537098 --- /dev/null +++ b/bin/rcsync @@ -0,0 +1,18 @@ +#!/bin/sh + +if [ ! -f ~/.config/rclone/folders.txt ]; then + echo 'Error! Please specify folders' + exit 1 +fi + +# -n = --dry-run +RCFILTER="--filter-from=${HOME}/.dotfiles/rclonefilter" + +DRY="--dry-run" +if [ "$1" = "ok" ]; then + DRY="" +fi + +while read -r line; do + rclone sync --skip-links -P ${DRY} ${RCFILTER} ${line%%:*} gdrive:${line##*:} +done < ~/.config/rclone/folders.txt diff --git a/rclonefilter b/rclonefilter new file mode 100644 index 0000000..33a951d --- /dev/null +++ b/rclonefilter @@ -0,0 +1,3 @@ +- *node_modules/** +- *.git/** +- *dist/**