From: Andre Noll <maan@systemlinux.org>
Date: Mon, 12 May 2008 15:42:35 +0000 (+0200)
Subject: Add new option --keep-redundant.
X-Git-Tag: v0.1.0~8
X-Git-Url: https://git.tue.mpg.de/?a=commitdiff_plain;h=c6c724ea61eb12710954d8e2043ca56b54f3e334;p=dss.git

Add new option --keep-redundant.
---

diff --git a/dss.c b/dss.c
index cd69c27..49be348 100644
--- a/dss.c
+++ b/dss.c
@@ -329,6 +329,8 @@ static int try_to_free_disk_space(int low_disk_space)
 	int ret;
 	struct snapshot_list sl;
 
+	if (!low_disk_space && conf.keep_redundant_given)
+		return 0;
 	dss_get_snapshot_list(&sl);
 	ret = remove_outdated_snapshot(&sl);
 	if (ret) /* error, or we are removing something */
diff --git a/dss.ggo b/dss.ggo
index 7892d53..8037373 100644
--- a/dss.ggo
+++ b/dss.ggo
@@ -323,3 +323,17 @@ details="
 
 	A value of zero (the default) deactivates this check.
 "
+
+option "keep-redundant" k
+#~~~~~~~~~~~~~~~~~~~~~~~~
+"Prune by disk space only"
+flag off
+details="
+	If this flag is not given dss removes redundant and outdated
+	snapshots automatically.
+
+	Otherwise, this feature is deactivated so that snapshots
+	are only being removed in case disk space or inode ratio
+	becomes low. Use this flag if the file system containing the
+	destination directory is used for snapshots only.
+"