summaryrefslogtreecommitdiff
path: root/yarns/0030-basics.yarn
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-02-06 23:25:51 +0000
committerLars Wirzenius <liw@liw.fi>2014-02-06 23:25:51 +0000
commit3713aabaaba16cad2ecfa85cb556755ffe2d664f (patch)
tree061a75a9439ee8d87129bc420278732defcb8f6c /yarns/0030-basics.yarn
parent6b6387c357faab0153c6dd9207dfec1e3779e7fc (diff)
downloadobnam-3713aabaaba16cad2ecfa85cb556755ffe2d664f.tar.gz
Make exclude-caches scenario clearer, robust
Originally, we would create L/wanted, then do a manifest, then create L/cache, then backup, restore, verify. This would sometimes fail, if the full-second timestamp of L would change when L/cache was created. So we (well, I) changed it so that we fiddled with the manifest just before making a backup, but this was weird and confusing and would still sometimes fail. This should now be much clearer and therefore more robust.
Diffstat (limited to 'yarns/0030-basics.yarn')
-rw-r--r--yarns/0030-basics.yarn20
1 files changed, 8 insertions, 12 deletions
diff --git a/yarns/0030-basics.yarn b/yarns/0030-basics.yarn
index ae553c14..7e4dffa2 100644
--- a/yarns/0030-basics.yarn
+++ b/yarns/0030-basics.yarn
@@ -171,23 +171,19 @@ directories tagged like that.
SCENARIO exclude cache directories
GIVEN 1k of new data in directory L/wanted
+ AND 1k of new data in directory L/cache
+ AND directory L/cache is tagged as a cache directory
-The directory `L` now contains what we want to restore: only the
-wanted data, no cache directory. This is a good time to create the
-manifest.
+We'll now create the manifest, but remove `L/cache` (and files in
+`L/cache`) so that it matches what we need. We do it this instead of
+creating the manifest before `L/cache`, because creating `L/cache`
+changes the timestamp of `L`.
AND a manifest of L in M
+ AND cache is removed from manifest M
-We now create the cache directory and tag it. Then we backup,
-excluding caches, and restore, and verify. However, there's a snag:
-the manifest has a modification time for `L` that is wrong: the
-creation of the cache directory modifies it. Thus, we also modify the
-manifest to update the first `Mtime` field, i.e., the one for the
-directory `L`.
+Time to backup.
- AND 1k of new data in directory L/cache
- AND directory L/cache is tagged as a cache directory
- AND manifest M has Mtime for the first entry set from L
AND user U sets configuration exclude-caches to yes
WHEN user U backs up directory L to repository R
AND user U restores their latest generation in repository R into X