gpg script in cron failed with "stdin must be a tty"
Mike Hsu
mhsu@nglm.com
Fri Aug 8 17:10:02 2003
I am running RedHat Linux AS 2.1.
I duplicate the process as root and it worked.
(logged in as root, create the keyrings and keys without passphrase, =
export, import, ...)
I am sure it's not the "rm", I tried it with or without "-f".
Mike Hsu (mhsu@nglm.com)
-----Original Message-----
From: Carl L. Gilbert [mailto:lamont_gilbert@rigidsoftware.com]
Sent: Friday, August 08, 2003 7:58 AM
To: Mike Hsu
Cc: GnuPG Users Group
Subject: RE: gpg script in cron failed with "stdin must be a tty"
On Fri, 2003-08-08 at 10:30, Mike Hsu wrote:
> Finally got it to work with root.
>=20
> Still having problem with other user.
>=20
what do you mean with root? is the root a user that holds gpg keys on
yoru system?
> crontab:
> DO NOT EDIT THIS FILE - edit the master and reinstall.
> # (/tmp/crontab.12587 installed on Fri Aug 8 07:14:39 2003)
> # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp =
$)
> 15 07 * * * su - oracle -c testdec.sh
>=20
What flavor of linux are you using? Why did you edit crontab as opposed
to just putting the script in
/etc/cron.hourly
or=20
/etc/cron.daily
etc.?
>=20
> testdec.sh:
> #!/bin/sh
> export GNUPGHOME=3D/home/oracle/.gnupg
> rm /usr/dba/junk.out
> gpg --output /usr/dba/junk.out --batch --no-tty --decrypt =
/usr/dba/junkx.gpg
> date > t.log
>=20
>=20
perhaps try=20
rm -f /usr/dba/junk.out
else rm could ask you to verify that you want to delete the file. for
me it only asks when I am logged in as root, but I do not know what cron
will do.
also if you have sendmail installed, you may want to check roots mail to
see any cron error messages.
--=20
Thank you,
CL Gilbert
"Then said I, Wisdom [is] better than strength: nevertheless the poor
man's wisdom [is] despised, and his words are not heard." Ecclesiastes
9:16
GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
GNU Privacy Guard http://www.gnupg.org (Encryption and Digital
Signatures)