[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tarsnap, cron, shell
Colin Brace wrote:
> On 04/05/2010 11:41 PM, Colin Percival wrote:
>> That error means that the cache directory Tarsnap is using it out of sync
>> with what's on the server. This almost certainly means that Tarsnap is
>> trying to use the wrong cache directory.
>
> OK, I see the problem. The /usr/local/etc/tarsnap.conf file contains the
> default values:
>
> cachedir /usr/local/tarsnap-cache
>
> whereas, the /root/.tarsnaprc contains:
>
> cachedir /home/colin/.tarsnap-cache
Which of those two directories did Tarsnap create files in?
> The root .tarsnap file contains:
> [...]
> but apparently the /usr/local/etc settings take precendence, although
> the man page suggests this is otherwise:
Just to be sure, you mean /root/.tarsnaprc, not /root/.tarsnap, right?
> Jobs in /usr/local/etc/periodic/daily are executed as root, right?
> Shouldn't tarsnap be reading and giving priority to the settings in
> /root/.tarsnaprc ?
Should be, yes. I wonder if the periodic runs are being done with a smaller
environment -- Tarsnap expands ~/.tarsnaprc by looking for the ${HOME}
environment variable, and it's possible that isn't being set. Do things
work if you change your periodic script to run
env HOME=/root/ tarsnap ...
instead? I should probably make tarsnap call use getpwuid() to get the
home directory rather than relying on ${HOME} being set.
--
Colin Percival
Security Officer, FreeBSD | freebsd.org | The power to serve
Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid