Skip to content

Instantly share code, notes, and snippets.

@ptrin
Last active November 7, 2016 01:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ptrin/d66183982277611b524e28dff51bd30b to your computer and use it in GitHub Desktop.

Import and backup

  • Monthly dumps from phones, sometimes camera to ~/Pictures on laptop
  • Every time the external HD is mounted, the backup.sh script runs to sync the ~/Pictures directory to the backup dir on the external - sometimes when I'm paranoid I run it manually and check to be sure it's working correctly
#!/bin/bash
if [ -d "/Volumes/My Book" ]; then
    rsync -a /Users/perry/Pictures /Volumes/My\ Book/_backup;
    rsync -a /Users/perry/Library/Application\ Support/Google/Picasa3 /Volumes/My\ Book/_backup/Picasa\ Metadata;
fi     
  • The backup script uses rsync with the archive flag so deletes on the source are not reflected on the destination
  • This allows me to delete some old directories of photos/videos from ~/Pictures on the laptop once they have been copied to the external HD and uploaded to Crashplan
  • Google Photos autobackup is also running on the ~/Pictures directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment