duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Duplicity-talk] Duplicity (GPG) fails in crontab only


From: Will McCown
Subject: Re: [Duplicity-talk] Duplicity (GPG) fails in crontab only
Date: Tue, 06 May 2014 11:53:41 -0700
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 5/6/2014 11:21 AM, Grant wrote:
>> 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.)

env command with no args will list the current environment.  So
logged in as root (in the state where the programs work) use it
to list the env vars and look for likely suspects.

One you've found the needed variable(s) you can add them to the
crontab with lines of the form:

ENVNAME=value

-- 
Will McCown, Rolling Hills Estates, CA
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]