It’s Cybersecurity Awareness Month! Join our interactive training session, or learn about security and AI from 1Password experts.
Forum Discussion
Former Member
3 years agoIs there a faster way to empty a vault using CLI2?
Hi, I have a requirement to empty certain vaults periodically and then refill them. I'd rather not delete the vault and recreate it and all the permissions if possible.
For a vault with 500 items ...
zcutlip
3 years agoDedicated Contributor
Again, for anyone who comes along, I have this working in a branch:
https://github.com/zcutlip/pyonepassword/tree/dev/82-support-batch-deletion
The API is:
python
def item_delete_multiple(self, vault, categories=[], include_archive=False,
tags=[], archive=False, name_glob=None, batch_size=25)
In testing, deleting 100 items with the default batch size of 25 takes about 42 seconds, vs 140 seconds looping over the vault's item list deleting one at a time (pyonepassword
first does an item_get()
for each item deleted, which adds some overhead).