From bfaa23c896df72b8b34ad70c723d05a206a56c19 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 11 Jun 2017 18:27:14 +0300 Subject: Fix: Make "obnam forget" for GA delete unused chunks --- test-ga-forget | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 test-ga-forget (limited to 'test-ga-forget') diff --git a/test-ga-forget b/test-ga-forget new file mode 100755 index 00000000..9bee8531 --- /dev/null +++ b/test-ga-forget @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2017 Lars Wirzenius + +set -eu + +obnam() +{ + env | grep OBNAM_PROFILE + ./obnam --no-default-config \ + --repository t.repo \ + --repository-format green-albatross-20160813 \ + --root t.data \ + --log t.log --log-level debug \ + "$@" +} + +rm -rf t.data t.repo t.log t.*.prof +genbackupdata --create 100M t.data +OBNAM_PROFILE=t.backup.prof obnam backup +genid="$(obnam genids)" +OBNAM_PROFILE=t.forget.prof obnam forget "$genid" + +echo +size="$(du -sm t.repo | awk '{print $1}')" +echo "Repository size: $size" +echo -n "Generations: " +obnam genids | tr '\n' ' ' +echo + +if [ "$size" -gt 1 ] +then + echo "FORGET DIDN'T REMOVE DATA" 1>&2 + exit 1 +fi -- cgit v1.2.1