#!/usr/bin/bash # => WIP # INCLUDES=('/home/will/**') EXCLUDES=('/home/*/.gvfs/**' '/home/*/.cache/**' '/home/*/.local/share/Trash/**' '/home/*/.vscode-server/**' '/home/*/node_modules/**') LOG_FILE="/tmp/rclone.log" set -o noglob filterOptions=() for option in ${EXCLUDES[@]}; do echo --filter="- $option" >> "$LOG_FILE" filterOptions+=(--filter="- $option") done for option in ${INCLUDES[@]}; do echo --filter="- $option" >> "$LOG_FILE" filterOptions+=(--filter="+ $option") done echo --filter="- /**" >> "$LOG_FILE" filterOptions+=(--filter="- /**") set +o noglob /usr/bin/rclone -P \ --dry-run \ -v \ --fast-list \ --skip-links \ --delete-excluded \ "${filterOptions[@]}" \ --suffix ".$(/bin/date +\%Y\%m\%d\%H\%M\%S)" \ sync \ /home/will/Code/ \ "minio-k0s:dev/"