[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tarsnap, cron, shell
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.
How this is happening exactly, I'm not sure; but do any/all of the
following files exist
/usr/local/etc/tarsnap.conf
/root/.tarsnaprc
/home/*/.tarsnaprc
and do they contain 'cachedir /path/to/somewhere' directives?
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
By way of explanation: I first set up tarsnap to backup a set of files
in my home directory. I created /usr/local/tarsnap-cache but everytime I
tried to run tarsnap as a user, it complained about being unable to
"sanitize permissions" in the cache dir, despite setting permissions as
go+rw, so I created a cache-dir in my home directory. When I went to
configure tarsnap to back up some system files via cron, I used the same
cache-dir in the root .tarsnaprc.
The root .tarsnap file contains:
# Tarsnap cache directory
# cachedir /Users/isaacs/.tarsnap/tarsnap-cache
cachedir /home/colin/.tarsnap-cache
# Tarsnap key file
keyfile /root/venus-tarsnap.key
[...]
but apparently the /usr/local/etc settings take precendence, although
the man page suggests this is otherwise:
[...]
FILES
${prefix}/etc/tarsnap.conf
The system global tarsnap configuration file. Parameters
speci-
fied here only take effect if they are not specified via
the cur-
rent user's local configuration file or via the command line.
~/.tarsnaprc
The tarsnap configuration file for the current user.
Parameters
specified here take effect unless they are specified via
the com-
mand line.
[...]
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 ? It appears not to be, since it also complained about
not being able to find the key file, despite this line in the root rc file:
keyfile /root/venus-tarsnap.key
(I created a symlink to fix that.)
Thanks.
--
Colin Brace
Amsterdam
http://lim.nl