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:
28
.scripts/backup_to_cloud.sh
Executable file
28
.scripts/backup_to_cloud.sh
Executable 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
|
Reference in New Issue
Block a user