I have a script that has a part that looks like that:
for file in `ls *.tar.gz`; do
echo encrypting $file
gpg --passphrase-file /home/$USER/.gnupg/backup-pas
It turns out that the answer was easier than I expected. There is a --batch
parameter missing, gpg tries to read from /dev/tty that doesn't exist for cron jobs. To debug that I have used --exit-on-status-write-error
param. But to use that I was inspired by exit status 2, reported by echoing $?
as Cd-Man suggested.