Change Rsync to Backup

- Change rsync menu to backup menu
- Add menu options for cloud and hdd backup
- Cloud backup uses rsync as before
- HDD backup uses snap-sync
This commit is contained in:
Sravan Balaji
2022-08-18 07:44:30 -04:00
parent 4e301b1b4a
commit b03d404447
5 changed files with 45 additions and 20 deletions

28
.scripts/backup_to_cloud.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# Define base paths
gdrive_path="/mnt/google-drive"
gdrive_personal_path="$gdrive_path/sr98vn@gmail.com"
home_path="/home/sravan"
# Define arrays
declare -a source_dirs=(
"$home_path/Calibre_Library/"
"$home_path/Pictures/Wallpapers/"
"$home_path/Documents/"
)
declare -a target_dirs=(
"$gdrive_personal_path/Calibre Library/"
"$gdrive_personal_path/Customization/Wallpapers/Desktop/"
"$gdrive_personal_path/Documents/"
)
# Loop through arrays
for i in ${!source_dirs[@]}; do
# Create target directories
mkdir -p "${target_dirs[$i]}"
# Copy source dirs to target dirs
rsync -a -v -L --progress --delete \
"${source_dirs[$i]}" \
"${target_dirs[$i]}"
done