You need both of these! From the gpg man page:
--batch Use batch mode. Never ask, do not allow interactive commands.
--no-tty Make sure that the TTY (terminal) is never used for any
output.
This option is needed in some cases because GnuPG sometimes
prints
warnings to the TTY if --batch is used.
--
Jean L. Francois - JLF Sends...
- Enterprise OS (LINUX) Load Development and Integration Engineering
Group
- Linux Counter Registered User #8863 1994-12-13 06:39:24
"The greatest enemy of knowledge is not ignorance, it is the illusion of
knowledge." -- Stephen Hawking
Torquemada Linux - For the Inquisitive...
>-----Original Message-----
>From: plug-discuss-admin@lists.plug.phoenix.az.us
>[mailto:plug-discuss-admin@lists.plug.phoenix.az.us] On Behalf
>Of Lynn David Newton
>Sent: Friday, September 03, 2004 2:03 PM
>To: plug-discuss@lists.plug.phoenix.az.us
>Subject: RE: GNUGPG problem
>
>
>
> jf> Test this in CRON and let me know what happens:
>
> jf> =====cut here=====
> jf> #!/bin/bash
> jf> cd /tmp
> jf> cat >/tmp/.pass <<EOF
> jf> password
> jf> EOF
> jf> cat thefile | gpg -z9 --no-version --textmode --comment
>"JLF Sends..."
> jf> --batch --yes --passphrase-fd 2 -a -v -v -c 2<.pass
> jf> =====cut here=====
>
>Thank you. That works, i.e., it sends a GPG-encoded
>message on stdout to email. I guess that's what it's
>supposed to do.
>
>Meanwhile, I discovered a large clue, running this
>script:
>
>----------------------- gcrypt ------------------------ #!/bin/ksh
>
>echo $(</path/to/key) |
> gpg --passphrase-fd 0 --symmetric $HOME/EncodeMe
>------------------------- end -------------------------
>
>I run it from a command line and EncodeMe.gpg is
>produced.
>
>I run it using at now + 1 minute, and I get an error
>message mailed to me that says in part:
>
>/home/lnewton/pbin/gcrypt: No controlling tty (open /dev/tty:
>No such device or address)
>/home/lnewton/pbin/gcrypt: Can't find tty file descriptor
>/home/lnewton/pbin/gcrypt: warning: won't have full job control
>
>I've seen this sort of thing from cron jobs before but
>have never paused to figure out how to deal with it.
>
>So what would be the next step, something to set up a controlling tty?
>
>--
>Lynn David Newton
>Phoenix, AZ
>---------------------------------------------------
>PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
>To subscribe, unsubscribe, or to change you mail settings:
>http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss