Files
willlaptop/scripts/rclone-sync.sh
2025-10-24 11:48:52 -07:00

37 lines
1.3 KiB
Bash
Executable File

#!/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/"