[enhancement] Smart delete modifications
Bug #406765 reported by
Bart de Koning
This bug affects 6 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Back In Time |
Fix Released
|
High
|
Unassigned |
Bug Description
Smart delete now only keeps all the snapshots for today and yesterday, and one for last week and the week before. I think the gap between yesterday and one week ago is quite big. What if a file got corrupted two days ago (Tuesday), but was created on Monday. It should keep one or two snapshots for the other days of the current week.
Manual settings for smart delete would be ideal of course, however might be a bit difficult to implement.
description: | updated |
summary: |
- Smart delete should keep also one snapshot per day for this week + [enhancement] Smart delete should keep also one snapshot per day for + this week |
Changed in backintime: | |
status: | New → Fix Committed |
Changed in backintime: | |
importance: | Undecided → Wishlist |
summary: |
- [enhancement] Smart delete should keep also one snapshot per day for - this week + [enhancement] Smart delete modifications |
Changed in backintime: | |
status: | Fix Committed → In Progress |
Changed in backintime: | |
importance: | Wishlist → Medium |
Changed in backintime: | |
status: | In Progress → Fix Committed |
Changed in backintime: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
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 remove_ keep_first_ ( snapshots, keep_snapshots, min_date, max_date )
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_
***
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