Last active
September 28, 2018 11:12
-
-
Save dwallraff/08687081f8fcff62ab30ee9e8072a3b8 to your computer and use it in GitHub Desktop.
Export all item metadata from 1Password
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
#! /usr/bin/env bash | |
## Copy all item metadata from 1password | |
# Get all item UUIDs | |
# shellcheck disable=2016 | |
op list items | jq -r '.[].uuid' > items_list | |
# Loop over list and save off all the metadata | |
TODAY=$(date "+%Y%m%d") | |
COUNTER=0 | |
TOTAL=$(wc -l < items_list) | |
while read -r i; do | |
(( COUNTER++ )) | |
echo "Getting item #$COUNTER of $TOTAL..." | |
op get item "$i" >> "$TODAY"_1password_backup.json; echo >> "$TODAY"_1password_backup.json | |
done < items_list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment