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

Re: tarsnap --print-stats without the cache?

On 02/18/17 06:39, Philip Paeps wrote:
> After moving some stuff around so my monitoring doesn't connect as root
> so much, the --print-stats bit stopped working because it can't read the
> cache directory.  Fair enough.
> I could presumably set an ACL on the cache directory but I wonder if
> this sort of thing really needs access to the cache.  I know that the
> Tarsnap server doesn't know anything about the individual archives, but
> it surely knows about the total amount of data stored.
> Colin: how do you feel about a variant of --print-stats that can print
> out the storage (and maybe the bandwidth too?) use for a particular key?

To elaborate a bit on what Graham wrote: The --print-stats operation works
by looking at the contents of the cache; it doesn't talk to the service at
all, and there's no client-server API for getting the total amount of storage
used.  (For a good reason: Tracking this in real-time would be expensive;
instead, it's computed for billing purposes by a daily job.)

There are two obvious options here:

1. When you create an archive, store the --print-stats output somewhere for
your monitoring code to read, so that it doesn't need to chew through the
cache to recompute the totals.

2. Download the billing details CSV from the tarsnap website.

Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid