Add various scripts for MinIO and Restic backup management
This commit is contained in:
36
scripts/rclone-sync.sh
Executable file
36
scripts/rclone-sync.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/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/"
|
||||
Reference in New Issue
Block a user