Reach the main text directly
HelpdeskDen

Backblaze old file versions: 3 deletion timing points

By
HelpdeskDen Editorial Team
Posted
Sources checked
Length
10 min read

Why the timing matters for a small office

Backblaze B2 deletes old versions on a scheduled Lifecycle Rules run after they have been hidden long enough to meet the rule's age. Then one day someone asks why a file from last spring is gone, or why an old draft is still sitting there when you thought the cleanup had already run. Both questions come down to timing. Old versions do not leave when you might expect. They leave when a rule measures them as old enough and a scheduled run actually does the removal.

Backblaze B2 handles this with Lifecycle Rules, which automate file deletion. The official documentation explains the timing with a worked example, and this post uses that example as the spine for three timing points. Keep the page open while you read. Every specific time, count, or delay below comes from that page, and we link to it wherever we use it.

The three points are these:

  1. A version's clock starts when a newer version hides it, not when the old version was first uploaded.
  2. Rules run on a schedule, so removal happens at the first run after the rule's age has been met.
  3. Newly created copies can be affected by the next run, so a fresh copy is not automatically settled.

None of this is hard once you see it laid out. The difficulty is that each point is easy to assume away, and assumptions are what cause surprises. A rule that looks clear on the settings screen can behave differently once real uploads and real schedules are involved.

Point 1: the clock starts when a newer version hides the old one

Backblaze B2 keeps versions of a file rather than replacing it outright. When you upload a new version, the older version still exists, but it is now hidden. The documentation shows this with a file called file.txt:

> "For example, if you upload the first version of file.txt on May 2, and then you upload a new version on May 9 at 06:00, there are now two versions: the May 2 version and the May 9 version." (Automate File Deletion with Backblaze B2 Lifecycle Rules)

The page then says what happens to the older version:

> "The May 2 version is hidden by the May 9 version, so it became hidden at the time the May 9 version was uploaded." (Automate File Deletion with Backblaze B2 Lifecycle Rules)

This is the first timing point. The age a rule cares about, for a hidden version, runs from the moment it was hidden. In the example, the May 2 version was first uploaded a week before it was hidden. The date that matters for deletion is May 9 at 06:00, because that is when the newer upload hid it.

That detail changes how you should think about cleanup. Suppose a file has been in the bucket for years and someone replaced it yesterday. The old version's clock started yesterday, not years ago. Now suppose someone edits a shared spreadsheet every afternoon. Each morning's version gets hidden by the next upload, so the hidden time of each version is set by the next save, not by anything the person chose on purpose.

For an office manager, this is the point to explain to staff first. People often think of a rule as "delete files older than X." A closer description is "delete versions that have been hidden for X." Those two statements give different results for a file that changes often, and the difference is usually where the surprise comes from.

A short exercise makes this concrete. Pick one file that gets edited regularly and list the upload time of each version. For every version except the newest, the hidden time is the upload time of the version that came after it. If that list does not line up with what you expected, the gap is where your retention plan needs work. You do not need special tools for this. A spreadsheet and a note of each upload time are enough for a first pass.

Point 2: rules run on a schedule, so removal waits for the next run

The second timing point is about when the rule actually does its work. The documentation uses a rule that deletes files one day after they are hidden, then follows the May 2 version through a few times of day. That walk-through is worth reading closely, because it shows that a one-day rule does not mean the file disappears exactly 24 hours after it is hidden.

Start with the first run in the example:

> "If there is a Lifecycle Rule that deletes files one day after they are hidden, and the Lifecycle Rules are applied at 01:00 on May 10, then nothing happens yet." (Automate File Deletion with Backblaze B2 Lifecycle Rules)

> "It has been 19 hours since the May 2 version was hidden." (Automate File Deletion with Backblaze B2 Lifecycle Rules)

At 01:00 on May 10, the version has been hidden for 19 hours. The rule wants one full day, so it does nothing. Then comes the next run:

> "The next day, on May 11, when the Lifecycle Rule is applied, something does happen." (Automate File Deletion with Backblaze B2 Lifecycle Rules)

> "If it runs at 01:00, it has now been 43 hours since the May 2 version was hidden, so the rule applies and the old version is deleted." (Automate File Deletion with Backblaze B2 Lifecycle Rules)

Here is the same example laid out as a timeline. The hour counts come from the quotes above, and the last column is a plain summary of what the rule does at each point:

Time Hours since the May 2 version was hidden What the rule does
May 9 at 06:00 Illustrative: 0 The May 9 upload hides the May 2 version
01:00 on May 10 19 The rule runs, but the one-day age is not met, so nothing happens
Illustrative: May 11 at 01:00 43 The rule runs, the age is met, and the old version is deleted

The table shows the lesson at a glance. One day after the version was hidden was 06:00 on May 10, by simple arithmetic. The first run after that point was at 01:00 on May 11. So the deletion came 43 hours after hiding, not 24. The rule's age is the earliest point at which removal can happen, not the exact moment it happens.

When you write a retention plan, treat the rule's age as a minimum. The removal can come later, and the delay depends on when the next scheduled run falls. This is why a staff member who checks on the second day and finds a file still there is not necessarily looking at a broken rule. They may be looking at the schedule working as described. The example also uses 01:00 only as a sample time, so do not assume your own runs happen at that hour. Check the timing that applies to your setup against the documentation.

Point 3: a new copy can be touched by the next run

The third timing point is the one most people skip. The documentation includes this caution:

> "It is possible that some newly created file replicas will be hidden or deleted when Lifecycle Rules are next applied (typically every 24 hours)." (Automate File Deletion with Backblaze B2 Lifecycle Rules)

Read it slowly. It says two things. First, the schedule is described as typical, not exact. The phrase "typically every 24 hours" describes a usual interval, so you should not plan around the hour to the minute. Second, the warning covers newly created file replicas, not only old versions. A copy made shortly before a run is not guaranteed to be left alone by that run.

Before a migration or a sync, review the full Lifecycle Rules documentation and any related pages it points to, so you know which of your files are affected.

A few practical habits can help:

  • Do not treat a freshly created copy as settled. Check it after at least one scheduled run has passed.
  • Keep the source, or another independent copy, somewhere else until you have verified the results of a bulk copy or migration.
  • When you plan a large batch of copies, schedule it so you can look at the results the next day, rather than at the end of a busy afternoon when nobody is paying attention.
  • Write down the date and time of any bulk operation, so that when someone asks why a file looks different, you can compare it with the rule runs that happened afterwards.

The reason this matters is that many small offices do a one-time bulk move and then assume everything is in its final place. A rule that runs afterwards can change that picture. The sensible approach is to verify, not to assume.

Putting the three points together

So a retention rule is really three things working together: an age, a schedule, and the upload history of each file. If you change one of them, the outcome changes. A shorter age does not help much if runs are infrequent, and a schedule that runs often does not help if the files you care about are never hidden. Looking at all three at once is what makes the behavior predictable.

This also explains why two buckets with the same rule can behave differently. One bucket might hold files that are rarely edited, so its old versions are hidden only now and then. Another might hold a shared working folder where files change daily, so its old versions are hidden constantly. The rule text is identical, but the timing your staff experiences is not.

A checklist for your bucket

Use this checklist when you set up or review a bucket:

  • Find every Lifecycle Rule on the bucket and write down its age.
  • Identify the folders where files change often. Their old versions are hidden frequently, so they are the first places where the rule will show up in daily work.
  • For each rule, plan on the age plus the wait until the next run. Do not promise staff an exact removal time.
  • After any bulk upload, copy, or migration, check the new copies after at least one scheduled run, and keep the source until you have done so.
  • Test changes in a separate test bucket before you change a production bucket. This lets you learn the timing without risking files you need.
  • Record each rule, its age, who owns it, and when someone last reviewed it. A short note in a shared document is enough for a small team.
  • Reread the official Lifecycle Rules documentation at each review, since it is the authority on how the rules behave. This post is only a plain-language summary of that page.

For related planning, see backup retention settings.

How to explain it to your team

You do not need to teach the whole mechanism to everyone. A short explanation is enough for most staff.

Give one example and most questions will answer themselves. The May 2 and May 9 example from the documentation works well, because it shows the hidden time, the first run that does nothing, and the run that removes the file. Staff who see that timeline usually stop asking why a file did not disappear the moment they expected.

If someone needs a file kept, the fix is to say so before the rule removes it, not after. Ask who owns the rule, and make sure the answer is written down where people can find it. A retention rule nobody can explain is a rule that will eventually cause a problem, usually at the worst possible moment. Clear ownership and a short written note prevent most of those problems.

Summary

Keep the official page nearby, test changes before you apply them to production, and write down what your rules do. The example in the documentation is short, and it answers most of the questions you will get about when old versions go.

Related guides: Backblaze lifecycle rules: 2 backup timing examples · Authenticator FIPS versions: 6 staff phone checks · Delete old backups safely with 7 checks on tax records.

Sources