I have the following script:
#!/bin/sh -e
PWD="supersecretpassword"
file="/backup/2do/example.txt"
echo before
echo $PWD | gpg --passphrase-fd 0 -c $file
echo after
The scripts works perfectly fine if executed manually, but simply stops working when the gpg line is performed when performed as crontab.
GPG shows:
gpg: cannot open `/dev/tty': No such device or address
I'm grateful for any suggestions!
Solution:
add --no-tty
to GPG