title: How to run gpg from a script run by cron?
body: <p>I have a script that has a part that looks like that:</p>
  
  <pre><code>for file in `ls *.tar.gz`; do
    echo encrypting $file
    gpg --passphrase-file /home/$USER/.gnupg/backup-passphrase \
      --simple-sk-checksum -c  $file
  done
  </code></pre>
  
  <p>For some reason if I run this script manually, works perfectly fine and all files are encrypted. If I run this as cron job, <code>echo $file</code> works fine (I see "encrypting &lt;file&gt;" in the log), but the file doesn't get encrypted and gpg silent fails with no stdout/stderr output.</p>
  
  <p>Any clues?</p>