script to clean my keyring

John Clizbe JPClizbe at
Tue Oct 30 01:57:53 CET 2007

Michael wrote:
> I like to clean my key ring automatically. I have put the attached lines 
> together to do this. But something is wrong, the script shows the data 
> which need to be changed but the update is not saved. Experts, what is 
> wrong here??
> for i in `gpg --list-keys --fixed-list-mode --with-colons |
> grep "^pub" | cut -f5 -d":"` ; do
>                 gpg --batch --yes --edit-key $i clean
> done

How about doing it this way:

    cp pubring.gpg pubring.tmp
    gpg --import-options import-clean --import pubring.tmp

> And a general Question: 
> I like to frequently run "gpg --refresh-key" and after this the above 
> script, in case it works, to get rid of the overhead. Do you think this 
> is a good idea to do so?

    gpg --keyserver-options import-clean \
      --keyserver refresh-keys

John P. Clizbe                   Inet:   John (a) GingerBear DOT nyet
Ginger Bear Networks             PGP/GPG KeyID: 0x608D2A10
"Be who you are and say what you feel because those who mind don't matter
and those who matter don't mind." - Dr Seuss, "Oh the Places You'll Go"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 679 bytes
Desc: OpenPGP digital signature
Url : /pipermail/attachments/20071029/c6318165/attachment.pgp 

More information about the Gnupg-users mailing list