From aaa53a78b2757ce0e8d4b18cf96f4d45c2c3ec90 Mon Sep 17 00:00:00 2001
From: Silvio Rhatto <rhatto@riseup.net>
Date: Mon, 30 May 2011 19:22:04 -0300
Subject: [PATCH] Allow disabling rotation or setting 2 days as minimum for
 backup increments in rsync short format (Issue #2107)

---
 handlers/rsync.in | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/handlers/rsync.in b/handlers/rsync.in
index ef0e636..767b6e0 100644
--- a/handlers/rsync.in
+++ b/handlers/rsync.in
@@ -35,7 +35,7 @@
 #   mountpoint = backup partition mountpoint or backup main folder (either local or remote)
 #   backupdir = folder relative do $mountpoint where the backup should be stored (local or remote)
 #   format = specify backup storage format: short, long or mirror (i.e, no rotations)
-#   days = for short storage format, specify the number of backup increments (min = 5)
+#   days = for short storage format, specify the number of backup increments (min = 2, set to 1 or less to disable)
 #   keepdaily = for long storage format, specify the number of daily backup increments
 #   keepweekly = for long storage format, specify the number of weekly backup increments
 #   keepmonthly = for long storage format, specify the number of monthly backup increments
@@ -290,9 +290,9 @@ function rotate_short {
   local keep="$2"
   local metadata="`dirname $folder`/metadata"
 
-  if [[ "$keep" -lt 4 ]]; then
-    error "Rotate: minimum of 4 rotations"
-    exit 1
+  # No rotations
+  if [[ "$keep" -lt 1 ]]; then
+     return
   fi
 
   if [ -d $folder.$keep ]; then
@@ -325,9 +325,9 @@ function rotate_short_remote {
   local metadata="`dirname $folder`/metadata"
   local keep="$2"
 
-  if [[ "$2" -lt 4 ]]; then
-    error "Rotate: minimum of 4 rotations"
-    exit 1
+  # No rotations
+  if [[ "$keep" -lt 1 ]]; then
+     return
   fi
 
 (
-- 
GitLab