add backup scritps
This commit is contained in:
parent
aa9d186a5a
commit
6c0870e817
3 changed files with 30 additions and 2 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit dad0bec1fef2833561d04ea446a544fbfde92539
|
||||
Subproject commit f10b4730176b567e15911b3c1a7c5a31c82c8b8e
|
||||
|
|
@ -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
28
scripts/cloud_sync
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue