Last active
March 5, 2016 17:54
-
-
Save interstateone/beb22b7073a7a53527ee to your computer and use it in GitHub Desktop.
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 | |
# | |
# ~/bin/backup-photos | |
file="Photos Library.photoslibrary" | |
path="/Users/brandon/Pictures/$file" | |
read -r -p "Do you want to backup $file to the Photo Storage volume? [y/N] " response | |
if [[ $response =~ ^([yY][eE][sS]|[yY])$ && -d "$path" ]]; then | |
rsync -av --delete --info=progress2 "$path" "/Volumes/Photo Storage/" | |
fi |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>ca.brandonevans.photobackup</string> | |
<key>Program</key> | |
<string>/Users/brandon/bin/spawn-photo-backup</string> | |
<key>StartOnMount</key> | |
<true/> | |
</dict> | |
</plist> |
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 | |
# | |
# ~/bin/spawn-photo-backup | |
volume="/Volumes/Photo Storage" | |
if [[ -d "$volume" ]]; then | |
open -Wna Terminal.app ~/bin/backup-photos | |
diskutil unmount "$volume" | |
echo "Photo Library Backup Complete" | |
/usr/bin/osascript -e 'display notification "You can now disconnect the backup drive." with title "Photo Library Backup Complete"' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment