Snap Sync Systemd Service

- Add service and timer for snap-sync
- Remove rsync scripts for phone (covered by syncthing)
  and external hdd (covered by snap-sync)
- Remove options for laptop and phone rsync scripts
  in rsync rofi menu
- Re-organize some sections of README.org
This commit is contained in:
Sravan Balaji
2022-08-16 16:39:48 -04:00
parent 1b39ef93cc
commit ab0b36e06e
6 changed files with 338 additions and 483 deletions

View File

@@ -1,19 +1,11 @@
#!/bin/bash
help_menu() {
echo "Main menu to launch run rsync scripts. Use only one argument at a time."
# echo " - Play / Pause: playerctl.sh --play-pause"
# echo " - Next: playerctl.sh --next"
# echo " - Previous: playerctl.sh --prev"
# echo " - Change Player: playerctl.sh --change"
# echo " - Rofi Menu: playerctl.sh --rofi"
# echo " - Help: playerctl.sh --help OR playerctl.sh -h"
}
rofi_menu() {
declare -a options=(
"   - rsync-laptop-to-cloud"
"   - rsync-laptop-to-external-hdd"
"   - rsync-laptop-to-phone"
" Back - back"
" Quit - quit"
)
@@ -40,12 +32,6 @@ main() {
--rsync-laptop-to-cloud)
kitty --hold /home/sravan/.scripts/rsync_laptop_to_cloud.sh
;;
--rsync-laptop-to-external-hdd)
kitty --hold /home/sravan/.scripts/rsync_laptop_to_external_hdd.sh
;;
--rsync-laptop-to-phone)
kitty --hold /home/sravan/.scripts/rsync_laptop_to_phone.sh
;;
--rofi)
rofi_menu
;;

View File

@@ -1,53 +0,0 @@
#!/bin/bash
# Define base paths
external_hdd_path="/run/media/sravan/5TB_HDD"
backup_path="$external_hdd_path/Backups"
home_path="/home/sravan"
# Define arrays
declare -a source_dirs=(
"$home_path/.cache/lutris/"
"$home_path/.cache/yuzu/"
"$home_path/.config/PCSX2/"
"$home_path/.config/dolphin-emu/"
"$home_path/.config/lutris/"
"$home_path/.config/retroarch/"
"$home_path/.config/rpcs3/"
"$home_path/.config/yuzu/"
"$home_path/Calibre_Library/"
"$home_path/Games/"
"$home_path/ISOs/"
"$home_path/Manga/"
"$home_path/Music/"
"$home_path/Pictures/"
"$home_path/Videos/"
)
declare -a target_dirs=(
"$backup_path/.cache/lutris/"
"$backup_path/.cache/yuzu/"
"$backup_path/.config/PCSX2/"
"$backup_path/.config/dolphin-emu/"
"$backup_path/.config/lutris/"
"$backup_path/.config/retroarch/"
"$backup_path/.config/rpcs3/"
"$backup_path/.config/yuzu/"
"$backup_path/Calibre_Library/"
"$backup_path/Games/"
"$backup_path/ISOs/"
"$backup_path/Manga/"
"$backup_path/Music/"
"$backup_path/Pictures/"
"$backup_path/Videos/"
)
# 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 \
--exclude '*/dosdevices/' \
"${source_dirs[$i]}" \
"${target_dirs[$i]}"
done

View File

@@ -1,25 +0,0 @@
#!/bin/bash
# Define base paths
phone_path="/run/user/1000/b2c922a2358570a6"
home_path="/home/sravan"
# Define arrays
declare -a source_dirs=(
"$home_path/Manga/"
"$home_path/Videos/"
)
declare -a target_dirs=(
"$phone_path/Manga/"
"$phone_path/Videos/"
)
# 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