[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Duplicity-talk] Duplicity (GPG) fails in crontab only
From: |
Grant |
Subject: |
Re: [Duplicity-talk] Duplicity (GPG) fails in crontab only |
Date: |
Tue, 6 May 2014 11:21:41 -0700 |
> Typically things fail in cron due to the relatively sterile
> environment that cron jobs inherit, although this failure
> sounds like gpg is unable to find the key rings. Are
> the key files in ~root/.gnupg/?
The keys are in /root/.gnupg and I just noticed that mysqldump also
fails in my cron script and works fine when I run it manually. Here's
the error:
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost'
(using password: NO) when trying to connect
I have the password in /root/.my.cnf.
> My idiom for testing cron script manually is to become
> root (or whatever other user the cron job is to run as)
> with su. then "env -i bash -norc".
I tried that with mysqldump and indeed I do get the access denied
error with the env and not without. Where should I look to find the
problem? (I'm keeping that env command, thanks.)
- Grant
>> Duplicity works fine if I run it manually as root, but the exact same
>> command run via cron as root fails with:
>>
>> GPGError: GPG Failed, see log below:
>> ===== Begin GnuPG log =====
>> gpg: encrypted with RSA key, ID *MASKED*
>> gpg: decryption failed: No secret key
>> ===== End GnuPG log =====
>>
>> Does anyone know why this happens?
>>
>> - Grant
Re: [Duplicity-talk] Duplicity (GPG) fails in crontab only, edgar . soldin, 2014/05/06