My Oracle Support Banner

[OSCS] Bulk-delete Objects On A Creation Date Criteria (Doc ID 2319560.1)

Last updated on NOVEMBER 29, 2019

Applies to:

Oracle Storage Cloud Service - Version 13.2 and later
Information in this document applies to any platform.


There is a need to bulk-delete some objects from a specific container in the Oracle Cloud Infrastructure Object Storage service, based on a creation date criteria (i.e. deleting every object with creation date before 1st October 2017).
To achieve this it was attempted to get a .TXT file containing the select objects by using CURL in a conditional GET method with 'If-Unmodified-Since' clause as a criteria filter as described either in REST API for Standard Storage in the Oracle Cloud Infrastructure Object Storage Classic and in RFC2616:
$ curl -X GET \
> "If-Unmodified-Since: Sun, 01 Oct 2017 00:00:00 GMT" \
> "" > objects_to_delete.txt
curl: (3) Port number ended with ' '
  % Total % Received % Xferd Average Speed Time Time Time Current
  Dload Upload Total Spent Left Speed
100 927k 100 927k 0 0 463k 0 0:00:02 0:00:02 --:--:-- 378k
But it didn't work as expected since some of the retrieved objects appear to have a 'Last-Modified' date NOT matching their 'If-Unmodified-Since' criteria:
$ curl -v -X HEAD \
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Last-Modified: Fri, 15 Sep 2017 08:24:42 GMT
How to achieve this operation correctly.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.