From 3713aabaaba16cad2ecfa85cb556755ffe2d664f Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 6 Feb 2014 23:25:51 +0000 Subject: 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. --- yarns/0030-basics.yarn | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'yarns/0030-basics.yarn') 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 -- cgit v1.2.1