- Newest
- Most votes
- Most comments
Hello.
If you use the lifecycle rules you have set, old versions of objects will be deleted after 3 days (lifecycle rules are asynchronous, so there will be a delay of a few hours).
The "days after becoming noncurrent" counter starts when the object version becomes noncurrent, not when it was created.
If you created objects 6 days ago but they only became noncurrent 1-2 days ago, they won't be deleted yet.
So I think it's possible that the object was created 6 days ago, but actually became non-current within the last 3 days.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html#lifecycle-actions-bucket-versioning-state
Just to be sure, did you select "Apply to all objects in the bucket" in the lifecycle rule settings to apply to the entire bucket?
If the rule does not apply to the entire bucket but only to a specific folder, some objects may not be deleted.
@Leo as far as I see, there are noncurrent-objects left only, which have a "isLatest" delete-marker. This is something like this:
key, versionid, IsLatest, IsDeleteMarker, Size, LastModifiedDate
"locks/097...285","Qsa...E6J","true","true","","2025-07-16T13:22:09.000Z"
"locks/097...285","1h4...F6P","false","false","178","2025-07-16T13:22:09.000Z"
I thought, the object itself would deleted, then there would be an (zero-size) delete-marker left only. But maybe this is desirable behavior. I will add a rule to "Delete expired object delete markers". Thank you very much for your help!
answered a year ago
No problem @Bernd. To be sure, a delete marker is only created when a current object version is deleted. Lifecycle rules only remove delete markers when they are the only object versions with a given key. In your list output, the 178-byte ..F6P version is noncurrent and has the same key as the delete marker ..E6J, so the delete marker isn't eligible for deletion, until the noncurrent object version ..F6P is deleted. A lifecycle rule targeting non-current versions will delete the non-current version, but only if Object Lock doesn't prevent it. Once the non-current version has been deleted, the delete marker that remains will be eligible for deletion when lifecycle rules get evaluated again the following day.

Using the inventory-csv I get something like this:
This means, the object is created/last-modified 2025-07-08 06:48:19 and has a delete-marker from 2025-07-08 06:50:50. The object becomes non-current at delete-markers last-modified date?
sorry, "Apply to all objects in the bucket": yes. The scope is "Entire bucket", I didn't create any filters or something other.
@Bernd, yes, that is correct. The object version is considered to have become non-current at the time the delete marker was created. Also note that lifecycle rules are executed as scheduled background jobs starting at midnight UTC time, and they don't perform exhaustive retries on transient failures. It often takes a few days for all matching object versions to finish getting deleted.
"..a few days...": ok, I will check the objects the next time and give an update. Thank your very much!
Yes, in most cases, about 95-99% of the eligible object versions are processed every day, so you should see a good amount of progress already on the first day. The deletion process may run at any time of day. It won't make stable, incremental progress throughout the day, starting at mightnight UTC, but might run the deletions in short bursts sometime in the afternoon or evening UTC time. Normally, you'll see the 95-99% of objects deleted by around 18-20 hours after mightnight UTC, and a similar percentage of the object versions that failed to get deleted on the first day getting deleted on the second day. Furthermore, the age of the object version is calculated from the exact timestamp, so an expiration time 3 days from 2025-07-08 06:48:19, for example, means that they will become eligible for deletion at 2025-07-11 06:48:19, so the first lifecycle rule execution where they'd be eligible for deletion (and where 95-99% of them would likely be deleted) would start at 2025-07-12 00:00:00 UTC, typically finishing around 18-20 hours later.