Trying to understand retention policies

#kopia policy show --global
Policy for (global):

Retention:
Annual snapshots: 2 (defined for this target)
Monthly snapshots: 6 (defined for this target)
Weekly snapshots: 16 (defined for this target)
Daily snapshots: 60 (defined for this target)
Hourly snapshots: 96 (defined for this target)
Latest snapshots: 10 (defined for this target)

Looking at snapshots for a folder I see:

2020-09-07 errors:1 (daily-28)
2020-09-08 (daily-27)
2020-09-09 (daily-26)
2020-09-10 errors:1 (daily-25)
2020-09-11 (daily-24)
2020-09-12 (daily-23)
2020-09-13 (weekly-4,daily-22)
2020-09-14 (daily-21)
2020-09-15 (daily-20)
2020-09-16 errors:1 (daily-19)
2020-09-17 (daily-18)
2020-09-18 errors:1 (daily-17)
2020-09-19 errors:2 (daily-16)
2020-09-20 errors:1 (weekly-3,daily-15)
2020-09-21 errors:2 (daily-14)
2020-09-22 errors:2 (daily-13)
2020-09-23 errors:1 (daily-12)
2020-09-24 errors:3 (daily-11)
2020-09-25 errors:2 (latest-10,daily-10)
2020-09-26 (latest-9,daily-9)
2020-09-27 (latest-8,weekly-2,daily-8)
2020-09-28 (latest-7,daily-7)
2020-09-29 (latest-6,daily-6)
2020-09-30 (latest-5,monthly-2,daily-5,hourly-5)
2020-10-01 errors:1 (latest-4,daily-4,hourly-4)
2020-10-02 (latest-3,daily-3,hourly-3)
2020-10-03 errors:1 (latest-2,daily-2,hourly-2)
2020-10-04 (latest-1,annual-1,monthly-1,weekly-1,daily-1,hourly-1)

I see the highest hourly is 5 on 9-30. So what exactly does this setting do?

Hourly snapshots: 96 (defined for this target)

Similarly, what does latest do?

“latest” is a quite literal prefix - it simply refers to the latest snapshot of each kind. I guess is is meant to be more approaching for the average user.

After each snapshot is taken, kopia will assign retention tag to snapshots and delete snapshots that don’t have any assigned tag.

Tags are assigned as follows:

  • latest-N will be assigned to all snapshots going backwards where the most recent snapshot gets latest-1, previous is latest-2 and so on.

  • hourly-N will be assigned to the latest snapshot within each respective hour, going back no more than M hours where M is defined by --keep-hourly parameter.

For example if you have done snapshots at:

2001-01-01 14:01 - not hourly because 14:30 was the last snapshot of this hour
2001-01-01 14:30 - hourly-2
2001-01-01 15:01 - not hourly because 15:55 was the last snapshot of this hour
2001-01-01 15:02 - not hourly because 15:55 was the last snapshot of this hour
2001-01-01 15:40 - not hourly because 15:55 was the last snapshot of this hour
2001-01-01 15:50 - not hourly because 15:55 was the last snapshot of this hour
2001-01-01 15:55 - hourly-1

Similarly daily-N is assigned to the latest snapshot within each day:

2001-01-01 14:01 - not daily because 15:55 was done the same day
2001-01-01 15:55 - daily-5
2001-01-02 14:01 - daily-4
2001-01-03 15:55 - daily -3
2001-01-04 14:01 - not daily because 15:01 was done the same day
2001-01-04 15:01 - daily-2
2001-01-05 15:55 - daily-1

Same rule applies to weekly, monthly, quarterly and annual retention rules - each of them retains latest snapshot within a given time period up to a defined limit.

Note the limit applies to both count and time, so if you have keep-hourly 48, it will keep no more than 48 hourly snapshots going back no more than 48 hours since the last snapshot.

1 Like

BTW to disable retention rules, set keep-latest to a very high number (1000000 or so).

Over time you should see the following pattern form (notice how the farther you go in time the less precise the snapshots become):

root@server:/etc
  2019-12-31 23:43:06 PST k4d62d9fa68ec9f59e8e15dbd59d6237f 35.8 MB dr-xr-xr-x files:2201 dirs:673 (annual-2,monthly-11)
  2020-01-31 23:43:20 PST kb4da91b17f97158c5aa402c81a0d07b9 35.8 MB dr-xr-xr-x files:2201 dirs:673 (monthly-10)
  2020-02-29 23:43:20 PST kf4aa4f481caaa94d59905ee772f90974 35.8 MB dr-xr-xr-x files:2206 dirs:675 (monthly-9)
  2020-03-31 23:43:45 PDT k668d6a47dd72d3707290413206de2d15 35.8 MB drwxr-xr-x files:2207 dirs:675 (monthly-8)
  2020-04-30 23:43:08 PDT kdb38b8ddc84e17aa0520d2de0f1ae0fb 2.3 MB drwxr-xr-x files:836 dirs:247 (monthly-7)
  2020-05-31 23:43:10 PDT kbe35cb256454d4ca2933e6e6efd7508e 2.4 MB drwxr-xr-x files:865 dirs:254 (monthly-6)
  2020-06-30 23:43:10 PDT kec04ecadb4be879d4f9876cd535835b1 3.2 MB drwxr-xr-x files:1365 dirs:342 (monthly-5)
  2020-07-31 23:43:09 PDT kbf2a6bd46494256c346c28216915bbda 6.5 MB drwxr-xr-x files:2067 dirs:444 (monthly-4)
  2020-08-31 23:43:11 PDT k9c9983d871953fd5a49a3d36866701ee 6.5 MB drwxr-xr-x files:2058 dirs:443 (monthly-3)
  2020-09-13 23:43:03 PDT ke25d294472040e3c3e6e4b847d028989 6.5 MB drwxr-xr-x files:2058 dirs:443 (weekly-4)
  2020-09-20 23:43:16 PDT k71e423328781abcba38c5dd885f145a1 6.5 MB drwxr-xr-x files:2065 dirs:443 (weekly-3)
  2020-09-27 23:43:06 PDT k5112c20f65c0f90a3639812379cbc754 6.6 MB drwxr-xr-x files:2108 dirs:455 (weekly-2)
  2020-09-28 23:43:13 PDT k3619994b7243d29d9845405b51e4eabb 6.6 MB drwxr-xr-x files:2108 dirs:455 (daily-7)
  2020-09-29 23:43:03 PDT k4f14591980600f5e57e071650a8249b8 6.6 MB drwxr-xr-x files:2108 dirs:455 (daily-6)
  2020-09-30 23:43:04 PDT k7bc3d8ebe0f8bd20b052f7e170d192b2 6.6 MB drwxr-xr-x files:2108 dirs:455 (monthly-2,daily-5)
  2020-10-01 23:43:02 PDT kb0dd658e7649e5d676ee335a50f5abbb 6.6 MB drwxr-xr-x files:2108 dirs:455 (daily-4)
  2020-10-02 23:43:09 PDT k95de214c93c2275a90c7db90a4c10e74 6.6 MB drwxr-xr-x files:2108 dirs:455 (daily-3,hourly-48)
  2020-10-03 00:43:14 PDT k014ef1258180e95d4ec0c98f72d8a704 6.6 MB drwxr-xr-x files:2108 dirs:455 (hourly-47)
  + 23 identical snapshots until 2020-10-03 23:43:14 PDT
  2020-10-04 00:43:09 PDT k4166d49efc2a31567a393761b184e1e0 6.6 MB drwxr-xr-x files:2108 dirs:455 (hourly-23)
  + 27 identical snapshots until 2020-10-04 22:53:23 PDT

I try to put it in context to help me understand.

Let’s consider only those hourly snapshots: if, for instance, you’re out of office with your laptop for three days, when you come back and connect to the server again, all the 48 hourly snapshots would get deleted (since they all are older than 48 hours), except for those also bearing the latest tag.

So, to respectfully correct @budy here, latest is not to make it approachable but is more of a safety net.

Do I get it correctly?

That is one way to view it.

Personally, after it was explained I saw it as a totally different workflow.
i.e. some people may just want to keep the latest X regardless of when it was backed up.

It also is way to retain additional hourly backups. I have one scenario where I have this

  • Need minimal loss of data during business hours. Currently have ZFS snapshots every 5 minutes during business hours
  • After 2 days just hourlies is fine

If I was to move that to Kopia it would be
12 * 8 * 2 latest
12 backups per hour… every 5 minutes
8 hours
2 days
I would set latest to at least 192 to be able to keep those 5 minutes periods for 2 days in addition to hourly 48 or higher (to keep the hourlies after the latest expires)

2 Likes

I’m not sure I get it.

That said, does kopia treat (from the retention standpoint) identical snapshots differently from others?

There’s not much value in retaining lots of identical snapshots. But, as it doesn’t cost space anyway, it doesn’t hurt. As long as it doesn’t trigger deletion of more useful (since they are not identical) snapshots simply because they are older.

I believe that identical backups are only retained for as long as the “latest” policy keeps them. For example

  2020-10-11 15:00:06 EDT ka702ad50bd08b49051414c754c615b5d 6.7 GB drwx------ files:35635 dirs:4815 (latest-4)
  2020-10-11 15:03:27 EDT kcd0cbbea189e35eebdcf266d1ab0748a 6.7 GB drwx------ files:35632 dirs:4815 (latest-3)
  + 2 identical snapshots until 2020-10-11 15:30:08 EDT

My understanding is that those two identical snapshots will be maintained.

My understanding is retention is as follows for each snapshot

  • Is this within the last retention number? If retention is 10 then at least 10 snapshots will be retained regardless of other policies.
  • Is this within the last number of hours for the hours policy. If hour policy is 48 one backup per hour will get flagged for retention for at least two days.
  • Same for daily, weekly, monthly, yearly

Then as maintenance runs it looks for any snapshots that don’t have a flag. Imagine you have latest to 4 and you do 2 backups per hour for 8 hours a day; hourly set to 48, dailies to 7 and weekly to 4

The last four backups will be retained because of the last copy policy, Then after 2 hours only one hourly is kept for up to 48 hours.
After 48 hours 1 daily is kept
After 7 days 4 weeklies are kept

‘Identical’ backups are simply a CLI/UI feature to collapse them. They are not really any different than the regular ones and have the same retention tags applied to them, so they can be retained by virtue of being hourly, daily, weekly or whatever.

You can see that using kopia snapshot ls -l - for example this is my backup of my /opt - notice how last 38 snapshots are identical but they carry different tags:

root@master:/opt
  2019-12-31 23:43:14 PST kae23540d7b7db98219046741bd310fe1 288.6 MB dr-xr-xr-x files:51 dirs:24 (annual-2,monthly-11)
  2020-01-31 23:43:20 PST kae23540d7b7db98219046741bd310fe1 288.6 MB dr-xr-xr-x files:51 dirs:24 (monthly-10)
  2020-02-29 23:43:14 PST kae23540d7b7db98219046741bd310fe1 288.6 MB dr-xr-xr-x files:51 dirs:24 (monthly-9)
  2020-03-31 23:43:09 PDT k3422b5492a0b7abe7b26e34e7fd590c0 581.3 MB drwxr-xr-x files:962 dirs:160 (monthly-8)
  2020-04-30 23:43:05 PDT kb4a5c00e59c1d3ee721e421fa1668b08 65.2 MB drwxr-xr-x files:19 dirs:10 (monthly-7)
  2020-05-31 23:43:05 PDT kb4a5c00e59c1d3ee721e421fa1668b08 65.2 MB drwxr-xr-x files:19 dirs:10 (monthly-6)
  2020-06-30 23:43:01 PDT k78fd70b9fe03153c45eee7fdf01ca52f 76.8 MB drwxr-xr-x files:20 dirs:12 (monthly-5)
  2020-07-31 23:43:03 PDT k8d20157064574a668b542d288d31b4da 391 MB drwxr-xr-x files:93 dirs:18 (monthly-4)
  2020-08-31 23:43:14 PDT k0bf12f0183a09b2b7cb0f7b9e7256d73 395.7 MB drwxr-xr-x files:93 dirs:18 (monthly-3)
  2020-09-20 23:43:12 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (weekly-4)
  2020-09-27 23:43:08 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (weekly-3)
  2020-09-30 23:43:17 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (monthly-2)
  2020-10-04 23:43:11 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (weekly-2)
  2020-10-05 23:43:01 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (daily-7)
  2020-10-06 23:43:09 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (daily-6)
  2020-10-07 23:43:15 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (daily-5)
  2020-10-08 23:43:06 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (daily-4)
  2020-10-09 23:43:12 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (daily-3,hourly-48)
  2020-10-10 00:43:10 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-47)
  2020-10-10 01:43:13 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-46)
  2020-10-10 02:43:01 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-45)
  2020-10-10 03:43:02 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-44)
  2020-10-10 04:43:16 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-43)
  2020-10-10 05:43:15 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-42)
  2020-10-10 06:43:11 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-41)
  2020-10-10 07:43:03 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-40)
  2020-10-10 08:43:06 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-39)
  2020-10-10 09:43:14 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-38)
  2020-10-10 10:43:07 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-37)
  2020-10-10 11:43:15 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-36)
  2020-10-10 12:43:10 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-35)
  2020-10-10 13:48:10 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-34)
  2020-10-10 14:43:08 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-33)
  2020-10-10 15:43:15 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-32)
  2020-10-10 16:43:01 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-31)
  2020-10-10 17:43:15 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-30)
  2020-10-10 18:43:04 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-29)
  2020-10-10 19:43:01 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-28)
  2020-10-10 20:43:06 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-27)
  2020-10-10 21:43:14 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-26)
  2020-10-10 22:43:12 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-25)
  2020-10-10 23:43:11 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (daily-2,hourly-24)
  2020-10-11 00:43:12 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-23)
  2020-10-11 01:43:13 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-22)
  2020-10-11 02:43:07 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-21)
  2020-10-11 03:43:02 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-20)
  2020-10-11 04:43:09 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-19)
  2020-10-11 05:43:05 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-18)
  2020-10-11 06:43:06 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-17)
  2020-10-11 07:43:12 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-16)
  2020-10-11 08:43:10 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-15)
  2020-10-11 09:43:08 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-14)
  2020-10-11 10:43:16 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-13)
  2020-10-11 11:43:10 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-12)
  2020-10-11 12:43:02 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-11)
  2020-10-11 13:43:05 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-10)
  2020-10-11 14:43:11 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-9)
  2020-10-11 15:43:11 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-8)
  2020-10-11 16:43:03 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-7)
  2020-10-11 17:43:11 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-6)
  2020-10-11 18:22:03 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (latest-10)
  2020-10-11 18:43:07 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (latest-9,hourly-5)
  2020-10-11 19:22:12 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (latest-8)
  2020-10-11 19:43:04 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (latest-7,hourly-4)
  2020-10-11 20:22:06 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (latest-6)
  2020-10-11 20:43:04 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (latest-5,hourly-3)
  2020-10-11 21:22:09 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (latest-4)
  2020-10-11 21:43:07 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (latest-3,hourly-2)
  2020-10-11 22:22:07 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (latest-2)
  2020-10-11 22:43:07 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (latest-1,annual-1,monthly-1,weekly-1,daily-1,hourly-1)

When you list without -l the output becomes:

root@master:/opt
  2019-12-31 23:43:14 PST kae23540d7b7db98219046741bd310fe1 288.6 MB dr-xr-xr-x files:51 dirs:24 (annual-2,monthly-11)
  + 2 identical snapshots until 2020-02-29 23:43:14 PST
  2020-03-31 23:43:09 PDT k3422b5492a0b7abe7b26e34e7fd590c0 581.3 MB drwxr-xr-x files:962 dirs:160 (monthly-8)
  2020-04-30 23:43:05 PDT kb4a5c00e59c1d3ee721e421fa1668b08 65.2 MB drwxr-xr-x files:19 dirs:10 (monthly-7)
  + 1 identical snapshots until 2020-05-31 23:43:05 PDT
  2020-06-30 23:43:01 PDT k78fd70b9fe03153c45eee7fdf01ca52f 76.8 MB drwxr-xr-x files:20 dirs:12 (monthly-5)
  2020-07-31 23:43:03 PDT k8d20157064574a668b542d288d31b4da 391 MB drwxr-xr-x files:93 dirs:18 (monthly-4)
  2020-08-31 23:43:14 PDT k0bf12f0183a09b2b7cb0f7b9e7256d73 395.7 MB drwxr-xr-x files:93 dirs:18 (monthly-3)
  2020-09-20 23:43:12 PDT ked5ecc8013e9ce6c4b587ad1150dbe4d 395.7 MB drwxr-xr-x files:93 dirs:18 (weekly-4)
  + 21 identical snapshots until 2020-10-10 12:43:10 PDT
  2020-10-10 13:48:10 PDT k11d8bc9966c1b9bb5367e6aad91a94b0 395.7 MB drwxr-xr-x files:93 dirs:18 (hourly-34)
  + 38 identical snapshots until 2020-10-11 22:43:07 PDT
1 Like

This doesn’t work on my machine:

  2023-07-28 06:46:16 +07 pins:initial-backup
  2023-07-30 04:34:14 +07 (daily-7) <-- This is not the latest time in the day
  2023-07-30 09:53:45 +07 (latest-10)
  2023-07-30 23:53:15 +07 (latest-9,daily-6,weekly-2) <-- Second snapshot of the day
  2023-08-01 01:35:07 +07 (latest-8,daily-5,monthly-2) <-- Not the latest time again
  2023-08-01 15:48:48 +07 (latest-7)
  2023-08-02 06:11:23 +07 (latest-6,daily-4) <-- Not the latest time
  2023-08-02 15:35:20 +07 (latest-5)
  2023-08-02 21:52:25 +07 (latest-4,daily-3) <-- Two daily snapshots again
  2023-08-03 15:15:50 +07 (latest-3,hourly-3)
  2023-08-04 05:12:52 +07 (latest-2,hourly-2,daily-2)
  2023-08-05 01:00:57 +07 (latest-1,hourly-1,daily-1,weekly-1,monthly-1,annual-1)

All snapshots were taken in the same timezone.

Does anyone know what’s going on here?

Is Kopia using the timezone of the SFTP storage?

Days seem to be based on the oldest snapshot, that rather than checking from 0:00, they’re broken into 24-hour bins based from the oldest snapshot, then the latest are checked from those bins. In your example, that would be:

2023-07-28 06:46:16 to 2023-07-29 06:46:15 (none)
2023-07-29 06:46:16 to 2023-07-30 06:46:15 (2023-07-30 04:34:14 is the only one in this duration, so daily)
2023-07-30 06:46:16 to 2023-07-31 06:46:15 (2023-07-30 23:53:15 is the latest in this duration, so another daily)
2023-07-31 06:46:16 to 2023-08-01 06:46:15 (2023-08-01 01:35:07 is the only one in this duration, so another daily)
2023-08-01 06:46:16 to 2023-08-02 06:46:15 (2023-08-02 06:11:23 is the latest in this duration, so another daily)
2023-08-02 06:46:16 to 2023-08-03 06:46:15 (2023-08-02 21:52:25 is the latest in this duration, so another daily)
2023-08-03 06:46:16 to 2023-08-04 06:46:15 (2023-08-04 05:12:52 is the latest in this duration, so another daily)
2023-08-04 06:46:16 to 2023-08-05 06:46:15 (2023-08-05 01:00:57 is the only one in this duration, so another daily)

Then assign numbers to them. This… is not intuitive at all, so I think this is a bug that should be rectified, @jkowalski.