diff options
author | Ian Campbell <ijc@hellion.org.uk> | 2014-12-07 15:22:27 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2014-12-08 20:53:31 +0200 |
commit | 44a578639ca864413bfb986e0c59cda9e567f743 (patch) | |
tree | 2f7000bf74b827ce7955bba681ff7d5ad384c6df /yarns/0300-kdirstat-integration.yarn | |
parent | d373c7f1bf17fc74b97d90605e0739d57aa777b8 (diff) | |
download | obnam-44a578639ca864413bfb986e0c59cda9e567f743.tar.gz |
Implement support for listing a generation in kdirstat.cache format
On Sat, 2014-12-06 at 19:15 +0200, Lars Wirzenius wrote:
> On Sun, Nov 16, 2014 at 11:24:11AM +0000, Ian Campbell wrote:
> > This implements an ls variant whose output format is compatible with the
> > kdirstat cache format. The best reference I can find for this is from an old fork:
> > https://github.com/thomas-joiner/k4dirstat/blob/master/kdirstat/cache-file-format.txt
> >
> > Recent versions of k4dirstat appear to be able to read the files produced just
> > fine, although this document is not present in their source AFAICT.
> >
> > I find k4dirstat to be an excellent way to visualise what is included in a
> > backup, e.g. for the purposes of excluding file types or marking directories
> > with a CACHEDIR.TAG. My previous solution involved post-processing the output
> > of ls which require a ssh to the machine with the files (for stat() purposes).
> > This approach pulls all of the data out of the obnam repo, so is much faster,
> > less hacky and gets the status of the actual generation and not the current
> > files etc.
>
> Thank you, Ian. I've applied the patch and pushed the changes to
> master on git.liw.fi.
Thanks.
> It would be nice if someone wrote a test case for this (in yarn form),
> so that I'll notice when I break it.
Your wish etc etc... (it even found a bug!)
8<----------------
>From 8f1aecfee8ec34e5d060f81ee47f9fd8aacdc201 Mon Sep 17 00:00:00 2001
From: Ian Campbell <ijc@hellion.org.uk>
Date: Sun, 7 Dec 2014 15:19:57 +0000
Subject: [PATCH] Add a yarn for testing kdirstat cachefile generation.
Rather simplistic, but caught one bug (unwanted newline at start of file) which
is also fixed here.
Diffstat (limited to 'yarns/0300-kdirstat-integration.yarn')
-rw-r--r-- | yarns/0300-kdirstat-integration.yarn | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/yarns/0300-kdirstat-integration.yarn b/yarns/0300-kdirstat-integration.yarn new file mode 100644 index 00000000..a2ff8e69 --- /dev/null +++ b/yarns/0300-kdirstat-integration.yarn @@ -0,0 +1,25 @@ +kdirstat integration: producing kdirstat cache files +==================================================== + +Obnam implements an ls variant whose output format is compatible with +the kdirstat cache format. + +Create a simple cache file +-------------------------- + +Here we create a simple backup and dump the output as a kdirstat cache +file. + + SCENARIO create and do a simple check of a kdirstat cache + GIVEN 10kB of new data in directory L + WHEN user U backs up directory L to repository R + AND user U creates a kdirstat cache file C of repository R + THEN first line of C matches [kdirstat 4.0 cache file] + AND for each file in directory L a line in the kdircache C matches it + +Validating the cache file +------------------------- + +Sadly there seems to be no CLI usable program to read or validate the +produced cache files. If there were we would do a more thorough test +of the syntax here. |