gpg Encryption, in Cron Job

An ecryption challenge using cron.

Below is my script... it is NOT working...

Here is the output... from command line

gpg: no valid addressees
gpg: /home/ssftp/.unencrypted/Audits_Feed_201110201702.txt: encryption failed: no such user id


for f in /home/lowessftp/.unencrypted/*.txt
  echo "Encrypting file $f ... "
  gpg --homedir /root/.gnupg --batch --no-tty  -o $
f.enc -e $f
        mv  /home/ssftp/.unencrypted/*.enc  /home/ssftp/export
        mv $f  /home/ssftp/.unencrypted/archive
Martin MillerCTOAsked:
Who is Participating?
Garry GlendownConsulting and Network/Security SpecialistCommented:
Did you sign the key or trust it? Most likely not. Either sign it using your private key, or alter the key so GPG will trust it:

$ gpg --edit the@key.adr
Command > trust
Please decide how far you trust this user to correctly
verify other users' keys (by looking at passports,
checking fingerprints from different sources...)?

 1 = Don't know
 2 = I do NOT trust
 3 = I trust marginally
 4 = I trust fully
 5 = I trust ultimately
 m = back to the main menu
Your decision? 5
Do you really want to set this key to ultimate trust? y
Command > save

Open in new window

Once done, you should be able to use it ... (signing the key also sets the trust to "5")
Garry GlendownConsulting and Network/Security SpecialistCommented:
add the recipient mail address (whose public key must be in the key ring) with "--recipient"
Martin MillerCTOAuthor Commented:
I got a little farther, and other ideas to this output ?
 Thx Martin
[root@lnn1111 .unencrypted]# sh /etc/cron.hourly/
Encrypting file /home/ssftp/.unencrypted/Factory_Audits_Feed_201110201702.txt ...
gpg: skipped: unusable public key
gpg: /home/ssftp/.unencrypted/Factory_Audits_Feed_201110201702.txt: encryption failed: unusable public key
Martin MillerCTOAuthor Commented:
Thank you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.