From owner-freebsd-questions@FreeBSD.ORG Tue Oct 25 18:18:33 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A37CC16A420 for ; Tue, 25 Oct 2005 18:18:33 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 622FC43D45 for ; Tue, 25 Oct 2005 18:18:33 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 441DE1A3C29; Tue, 25 Oct 2005 11:18:33 -0700 (PDT) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id B299A51248; Tue, 25 Oct 2005 14:18:32 -0400 (EDT) Date: Tue, 25 Oct 2005 14:18:32 -0400 From: Kris Kennaway To: Robert Wall Message-ID: <20051025181832.GA61086@xor.obsecurity.org> References: <20051025131352.217826@bob> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wac7ysb48OaltWcw" Content-Disposition: inline In-Reply-To: <20051025131352.217826@bob> User-Agent: Mutt/1.4.2.1i Cc: freebsd-questions@freebsd.org Subject: Re: Crontab and GPG? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2005 18:18:33 -0000 --wac7ysb48OaltWcw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 25, 2005 at 01:13:52PM -0500, Robert Wall wrote: > Hello! I'm attempting to run GPG from cron, and it's not working. I can= run the script from the command line, and all works perfectly. When I try= to run it from cron, however, it doesn't work. The crontab calls this scr= ipt, called "pgpdecrypt" with the following crontab line: >=20 > */1 * * * * root /bin/bash /etc/pgpdecrypt >=20 > The /bin/bash wasn't originally there; I added it to make sure that the s= cript was using the correct shell. Still no luck. Here's the script that = it calls: >=20 > echo >> /etc/pgpdecrypt.logger "PGP Decrypter Starting" > cd /home/folder > for filename in `ls *pgp` > do > gpg --batch --no-tty --passphrase-fd 0 --output /home/folder/pgp-decrypte= d/$filename.txt --decrypt /home/folder/$filename < /home/folder/pp > /home/folder/pgp-decrypted/import.pl /home/folder/pgp-decrypted/$filename= .txt > echo >> /etc/pgpdecrypt.logger "/home/folder/$filename /home/folder/pgp-o= riginal/$filename" > done >=20 > The output file is cheerfully logging the filenames appropriately. /var/= log/messages doesn't contain any errors. Anybody got any ideas? Even if I= could get a competent logging mechanism in place to see why GPG doesn't fe= el like running, that would be great. You're assuming gpg is in PATH, which it probably isn't. crontab errors aren't logged in /var/log/messages anyway (they're mailed to you) - see the manpages. Kris --wac7ysb48OaltWcw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDXnb4Wry0BWjoQKURAsHmAKDz2wHh2Nnt+obuQQC1hlP6SlFt3gCeJ77w f1QiKezVw6SCh0FGpdzyAhc= =8omE -----END PGP SIGNATURE----- --wac7ysb48OaltWcw--