Comment 1 for bug 406765

Revision history for this message
Bart de Koning (bratdaking) wrote : Re: [enhancement] Smart delete should keep also one snapshot per day for this week

Having manual settings was to much of a hassle right now :-), but if anybody likes to keep additional snapshots for the rest of the week, copy and paste the following lines of code into

/usr/share/backintime/common/snapshots.py

at line 783 (that is in the smart_remove def between the code to keep today and yesterday, and last week), mind the spacing!
***

  #one per day for the rest of this week
  if now.weekday() > 1:
   for weekday in xrange( 1, now.weekday() ):
    #print "weekday: %s" % weekday
    max_date = now - datetime.timedelta( days = weekday + 1 )
    min_date = max_date
    keep_snapshots = self._smart_remove_keep_first_( snapshots, keep_snapshots, min_date, max_date )

***
For the convenience I included my whole snapshots.py

I am not sure whether more people would like this behaviour, so I did not include this into a new development branch or something, neither did I polish the settings dialog.

Cheers