Merge branch 'main' of codeberg.org:aleidk/dots

This commit is contained in:
Alexander Navarro 2023-10-07 15:34:21 -03:00
commit 7b7d0f871f
3 changed files with 30 additions and 2 deletions

@ -1 +1 @@
Subproject commit dad0bec1fef2833561d04ea446a544fbfde92539
Subproject commit f10b4730176b567e15911b3c1a7c5a31c82c8b8e

View file

@ -7,7 +7,7 @@ source "$DOTS/config/zsh/config/colors.zsh" && define_colors
LOCAL_BACKUP_PATH="$HOME/Drives/Backups/auto-backups/"
REMOTE_BACKUP_PATH="auto-backups"
RCLONE_CLOUD_NAME="mega"
RCLONE_CLOUD_NAME="GDrive"
DATE_FORMAT="+%F"

28
scripts/cloud_sync Executable file
View file

@ -0,0 +1,28 @@
#!/usr/bin/env bash
RCLONE_CLOUD_NAME='GDrive'
declare -A SOURCES
# key local, value remote
SOURCES["$HOME/Drives/Stuff/Pictures"]="/01_Personal/01_Pictures"
SOURCES["$HOME/Drives/Stuff/Music"]="/01_Personal/02_Music"
SOURCES["$HOME/Drives/Backups/auto-backups/services/last"]="/80_Backups/Services"
config="$(rclone config dump 2>/dev/null | jq ".$RCLONE_CLOUD_NAME // empty")"
if [[ -z "$config" ]]; then
echo -e "${RED}${SHL}No Rclone configuration! skiping sync.${RST}${EHL}\n"
return
fi
for i in "${!SOURCES[@]}"; do
local=$i
remote=${SOURCES[$i]}
rclone bisync \
--copy-links \
--progress \
--resync \
--stats-one-line \
"$local" "${RCLONE_CLOUD_NAME}:${remote}"
done