Skip to content

Instantly share code, notes, and snippets.

@alyssais
Created February 21, 2016 16:54
Show Gist options
  • Save alyssais/2c8b7adeb67af9d72d09 to your computer and use it in GitHub Desktop.
Save alyssais/2c8b7adeb67af9d72d09 to your computer and use it in GitHub Desktop.
Sometimes I need access to my 1Password database on another computer. This launchd task will automatically copy my database to a USB drive as soon as it's changed.
#!/bin/sh
if ! [ -d "/Volumes/RECOVERY" ]; then
echo "Not connected"
exit 1
fi
mkdir -p "/Volumes/RECOVERY/passwords"
rsync -az --delete --exclude ".DS_Store" \
"/Users/penman/dropbox/Apps/1Password/1Password.agilekeychain" \
"/Volumes/RECOVERY/passwords"
<?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>com.rosspenman.backuppasswords</string>
<key>Program</key>
<string>/Users/penman/bin/backup_passwords</string>
<key>StartOnMount</key>
<true/>
<key>WatchPaths</key>
<array>
<string>/Users/penman/dropbox/Apps/1Password/1Password.agilekeychain</string>
</array>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment