photo-drive-sync.sh (1275B)
1 #!/bin/bash 2 3 diskA=/Volumes/SUSAN 4 diskB=/Volumes/backup 5 6 echo "Copying from local drive to first external drive ($diskA)" 7 8 # Lightroom 9 echo "Copying Lightroom files to first external drive ($diskA)" 10 rsync -rav --progress ~/Pictures/Lightroom $diskA/Anders\ flaptop/ 11 rsync -rav --progress ~/iCloud/Lightroom-exports $diskA/Anders\ flaptop/ 12 13 # Capture One 14 echo "Copying Capture One files to first external drive ($diskA)" 15 rsync -rav --progress --delete ~/Pictures/Capture\ One\ Catalog.cocatalog $diskA/Anders\ flaptop/ 16 rsync -rav --progress ~/Pictures/CaptureOne\ exports $diskA/Anders\ flaptop/ 17 18 # Photos.app 19 echo "Copying Photos.app files to first external drive ($diskA)" 20 rsync -rav --progress ~/Pictures/Photos\ Library.photoslibrary $diskA/Anders\ flaptop/ 21 rsync -rav --progress ~/Pictures/Photos\ exports $diskA/Anders\ flaptop/ 22 23 if [ -d $diskB ]; then 24 echo "Mirroring external drives ($diskA -> $diskB)" 25 rsync -rav --delete --exclude="/.*" --progress $diskA/ $diskB 26 fi 27 28 read -p "Unmount external drive $diskA? [y/N] " -n 1 -r 29 echo 30 if [[ $REPLY =~ ^[Yy]$ ]]; then 31 diskutil eject $diskA 32 fi 33 34 if [ -d $diskB ]; then 35 read -p "Unmount external drive $diskB? [y/N] " -n 1 -r 36 echo 37 if [[ $REPLY =~ ^[Yy]$ ]]; then 38 diskutil eject $diskB 39 fi 40 fi