gpg on cron task

enediel gonzalez enediel at hotmail.com
Mon Feb 6 16:41:03 CET 2006


I'm sorry Atom for the personal email, I just replied the message without 
change the address.

Following the suggestions I created the script

#!/bin/bash
cd /tmp/backup && /bin/echo apassword | /usr/bin/gpg -se --passphrase-fd 0 
--logger-fd 1 -r enediel at hotmail.com /tmp/backup/backup20060206100521 >> 
/tmp/debug3.txt

Executing it from a cron task I obtained in /tmp/debug3.txt the following 
line
gpg: cannot open `/dev/tty': No such device or address

according to this line, it looks line the way I use to pass the password to 
gpg is incorrect when the script is used on a cron task.

?Could somebody show me an example how to do it in any way?
I'm sorry, I searched without find the answer to this question.

Thanks in advance for any answer
Enediel
Linux user 300141
Debian GNU/Linux




>From: Atom Smasher <atom at smasher.org>
>To: enediel gonzalez <enediel at hotmail.com>
>Subject: Re: gpg on cron task
>Date: Sat, 4 Feb 2006 11:50:26 -0500 (EST)
>
>On Sat, 4 Feb 2006, enediel gonzalez wrote:
>
>>This computer is not critical, is a black box containing a specific system 
>>with a web interface.
>>
>>I understand your point regarding the password, for the nature of this 
>>case it's not the most important thing, I gonna save the backup file on an 
>>external ftp server, where I'll need this protection.
>>
>>My question is, no matter if I use php or another shell for the scripts, 
>>why if as root I execute my script and I obtained the .gpg file, and when 
>>I execute a root's cron task, the same script fails.
>=====================
>
>if your using gpg and php, at least check this out - 
>http://business-php.com/opensource/gpg_encrypt/
>
>i can make a lot of guesses about why it's not working, but the only thing 
>that will really give me a hint is to know why it's not working. run the 
>cron job with a verbose flag and record the output to stderr. something 
>like this, but you'll probably have to modify it based on your particular 
>script:
>	{ gpg -ea *file* ; } 2>&1
>or add this to the gpg options on the command line:
>	--logger-fd 1
>
>then send us the output and someone here can probably figure it out really 
>quickly.
>
>
>--
>         ...atom
>
>  _________________________________________
>  PGP key - http://atom.smasher.org/pgp.txt
>  762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
>  -------------------------------------------------
>
>	"Freedom without opportunity is a devil's gift, and the
>	 refusal to provide such opportunities is criminal"
>		-- Market Democracy in a Neoliberal Order:
>			Doctrines and Reality, Noam Chomsky
>
>





More information about the Gnupg-users mailing list