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/**