On Sat, Jul 11, 2009 at 10:57:51PM +0200, intrig...@boum.org wrote:
> Hi,
> 
> martin f krafft wrote (06 Jul 2009 17:34:55 GMT) :
> > One problem with duplicity is that old snapshots cannot be removed
> > while incremental snapshots are appended. --full-if-older-than
> > DATESPEC is a nice solution, as it creates a new full snapshot every
> > DATESPEC invocations.
> 
> Much agreed, thanks for the suggestion.
> 
> As usual: no upstream is alive and kicking to add features to the dup
> handler, but I'll go on fixing bugs and helping people to produce
> patches I'll dare apply to upstream's Git.
> 

Here's a first attempt at adding such a feature, which would by default create 
a new full backup every half of the keep period.

So for instance, if one keeps backups for 60 days, a full new backup will be 
created every 30 days, so 2 complete full will be kept, without accumulating 
too many incrementals.

Any comments welcome.

-- 
Olivier BERGER 
(OpenPGP: 1024D/B4C5F37F)
http://www.olivierberger.com/weblog/
diff --git a/handlers/dup.in b/handlers/dup.in
index ffae48c..00fd786 100644
--- a/handlers/dup.in
+++ b/handlers/dup.in
@@ -163,6 +163,15 @@ if [ "$incremental" == "no" ]; then
    else
       execstr_command="full"
    fi
+else
+   if [ "$keep" != "yes" ]; then
+      fullifolderthan="30D"
+      if [ "`echo $keep | tr -d 0-9`" == "" ]; then
+         let "fullifolderthan = keep / 2"
+         fullifolderthan="${fullifolderthan}D"
+      fi
+      execstr_options="${execstr_options} --full-if-older-than $fullifolderthan"
+   fi
 fi
 
 ### Temporary directory

Reply via email to