Automatic update of keyring

Dave Chapeskie gnupg@ddm.wox.org
Tue Sep 11 14:30:01 2001


--opJtzjQTFsWo+cga
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Sep 09, 2001 at 03:33:32PM -0400, Walt Mankowski wrote:

> > alias gpg-update-all 'gpg --with-colons --fast-list-mode --list-keys |
> > awk -F: '\''$1=3D=3D"pub" {print $5}'\'' | sort -u
> > | xargs -n 20 gpg --recv-keys'
>=20
> This is a simpler way of doing it:
>=20
> gpg --recv-keys `gpg --list-keys | grep ^pub | cut -b 12-19`
>=20
Simpler but incorrect: * if you have more keys than will fit on the command line (like I do) your method fails, that's one of the reasons xargs(1) exists * cut(1) is using column positions in the output which are not guarenteed to stay the same in future GnuPGP releases, that's why the --with-colons option exists * --fast-list-mode makes a HUGE time difference on my keyring, that's what it's there for * using grep and cut is two processes to awk's one The only things that are not strictly necisary in my alias are the pass through "sort -u" and the "-n 20" option to xargs. I did the former to remove duplicate keyid's, which there shouldn't be but I copied it from another alias I had and it doesn't hurt. I did the later because I didn't want gpg holding the lock files for the entire time it was updating, this way it gives it up briefly after after every twenty keys. --=20 Dave Chapeskie OpenPGP Key KeyId: 3D2B6B34 --opJtzjQTFsWo+cga Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) iEYEARECAAYFAjueA2kACgkQWqkc/T0razSU/QCghvK9+pa2QaLnnXm7t7GDDhFD QEUAoMzrfufrIuOMORyEGbXLyJ5XjyxN =E1PD -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga--