Created
August 7, 2024 09:06
-
-
Save kelso/17d7e38940a209574625a5ac434710d0 to your computer and use it in GitHub Desktop.
My photos backup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Function to perform each backup option | |
function backup_option() { | |
case $1 in | |
1) | |
rsync -aWh --delete --info=progress2 "/Users/sh/Pictures/Lightroom Catalogs/" "/Volumes/T7 Shield/Lightroom Catalog Backups (Do Not Edit Here)/" | |
;; | |
2) | |
rsync -aWh --delete --ignore-errors --info=progress2 "/Volumes/T7 Shield/" "/Volumes/8TB_WD_RED_1/T7 Shield/" | |
;; | |
3) | |
rsync -aWh --delete --ignore-errors --info=progress2 "/Volumes/8TB_WD_RED_1/" "/Volumes/8TB_WD_RED_2/" | |
;; | |
*) | |
echo "Invalid option: $1" | |
;; | |
esac | |
} | |
# Prompt the user for backup choice | |
echo "Select the backup you want to perform:" | |
echo "1. Backup local Lightroom Catalogs to T7 Shield" | |
echo "2. Backup T7 Shield to 8TB_WD_RED_1" | |
echo "3. Backup 8TB_WD_RED_1 to 8TB_WD_RED_2" | |
read -p "Enter your choice (1-3): " choice | |
# Check if choice is valid and execute the chosen option | |
if [[ "$choice" =~ ^[1-3]$ ]]; then | |
backup_option "$choice" | |
else | |
echo "Invalid choice." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment