Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Oct 2005 14:18:32 -0400
From:      Kris Kennaway <kris@obsecurity.org>
To:        Robert Wall <cp@web-walrus.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Crontab and GPG?
Message-ID:  <20051025181832.GA61086@xor.obsecurity.org>
In-Reply-To: <20051025131352.217826@bob>
References:  <20051025131352.217826@bob>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
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 script, called "pgpdecrypt" with the following crontab line:
> 
> */1    *       *       *       *       root    /bin/bash /etc/pgpdecrypt
> 
> The /bin/bash wasn't originally there; I added it to make sure that the script was using the correct shell.  Still no luck.  Here's the script that it calls:
> 
> 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-decrypted/$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-original/$filename"
> done
> 
> 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 feel 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

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iD8DBQFDXnb4Wry0BWjoQKURAsHmAKDz2wHh2Nnt+obuQQC1hlP6SlFt3gCeJ77w
f1QiKezVw6SCh0FGpdzyAhc=
=8omE
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051025181832.GA61086>