Encrypting Cron job email output.

Mads Laursen gnupg at dossen.dk
Tue Aug 24 16:01:02 CEST 2004


On 24/08/04 14.45, simon wrote:
> On Monday 23 Aug 2004 22:15, Atom 'Smasher' wrote:
> > On Mon, 23 Aug 2004, Werner Koch wrote:
> > >> /usr/sbin/chkrootkit 2>&1 | mail -s "chkrootkit
> > >> output"saulinux at safe-mail.net
> > >
> > > insert "gpg -ear somekey --always-trust" into the pipeline.
> >
> > ==================
> >
> > that will only encrypt stdout, leaving stderr (if there is any)
> > unencrypted. solve that by running:
> >  	cron-job-command 2>&1 | gpg --trust-model always -ear somekey
> >
> > ("--trust-always" is deprecated, use "--trust-model always")
> > (also, as a matter of habit, options before commands (mostly))
> here is the command and output from a shell ;
> [root at localhost simon]# /usr/sbin/chkrootkit 2>&1 | gpg 
> output" saulinux at safe-mail.net
> gpg: F679C9E6223DC22B: skipped: public key not found
> gpg: [stdin]: encryption failed: public key not found
> Where am I going wrong? Is the command OK? My public key is valid 
> and on my keyring, why isn't it being seen?

Try
  gpg --keyring /path/to/your/key --trust-model always -ear somekey
I find that, when using cron, it pays to be explicit.

/dossen
-- 
Common sense is the collection of prejudices acquired by age eighteen.
                -- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /pipermail/attachments/20040824/2333f661/attachment.bin


More information about the Gnupg-users mailing list