Custom backup retention unexpectedly deleted a backup

I’m using “1W:1D,4W:1W” as my custom retention policy. This particular machine is not always powered on, so does not always backup. As of Nov 21, 2018, after today’s backup, it has the following backup sets:

0: Nov 21, 2018 1:47 PM
1: Nov 19, 2018 3:38 PM
2: Nov 15, 2018 11:48 AM
3: Nov 6, 2018 6:38 PM
4: Oct 30, 2018 11:31 AM

A backup had also been performed on Nov 20, and to my surprise, when today’s backup (Nov 21) completed, it deleted the Nov 20 backup.

My understanding from the online help is that the “1W:1D” is equivalent to “7D:1D”, so I would have expected it to retain a backup each day for the past 7 days. Yet it deleted yesterday’s (Nov 20). That was the only backup performed on the 20th too.

Is this a possible bug or am I misunderstanding something?

(Duplicati version:

May be a misunderstanding, although that would depend on when the Nov 20 backup was. If it was less than 1 day (i.e. 24 hours) after the Nov 19 backup, it would be deleted because you asked to retain 1 backup per day. You’re correct that 1W is 7D, and ultimately things turn into seconds. You can see the exact decision-making if you like, by using logging at Information level or (gets very wordy) Profiling level. Or just know it’s not calendar.

1 Like

Thanks for the explanation ts678. Yes, the Nov 20 backup – like the Nov 21 backup – had a timestamp of exactly 1:47 PM (the scheduled time). So the Nov 20th backup was within 24 hours of the Nov 19th backup. Good to understand it’s not calendar days that it’s following.

You should use “1W:U,4W:1W”, then all backups will be retained for the first week.

1 Like

Though it’s not mentioned very much in documentation, you can also use h for hours, m for minutes, and s for seconds in combination with the usual uppercase letters, so scheduled dailies can be kept by setting 1W:23h.