[OSCS] Bulk-delete Objects On A Creation Date Criteria

(Doc ID 2319560.1)

Last updated on OCTOBER 29, 2017

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" \
> "https://axxxxxx.storage.oraclecloud.com/v1/Storage-axxxxxx/OracleReservedBlockStorageSnapshot-Data-compute-em2-z23-em2" > 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 \
> https://axxxxxx.storage.oraclecloud.com/v1/Storage-axxxxxx/OracleReservedBlockStorageSnapshot-Data-compute-em2-z23-em2/zfssend/0e570764a509f18b4ea89a2b9f2e25099d622c3c998790c4563857d049593509/data/segment-00000001
* 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.


Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms