Managing Cloud Target Lifecycle Rules (CLI)

You can manage a cloud target's lifecycle to streamline management of backup data. Each cloud target can have up to two rules: archive and delete. For example, you can set rules to archive backups after 30 days and delete them after 90 days. Some options are disabled based on the type of target, so archiving rules are restricted on archive buckets and ZFSSA targets to ensure correct configuration. The rules must be unique and you must set a duration of at least 1 day.

  1. Go to configuration services cloud targets.
    hostname:configuration services cloud targets>
  2. Find and select the cloud target to apply a lifecycle rule, and enter ls to view its properties.
    hostname:configuration services cloud target-000> ls 
    Properties:
                          name = oci-phoenix
                      location = https://objectstorage.us-phoenix-1.oraclecloud.com
                          user = ocid1.user.oc1..aaa56chx6rcm53g4tij74pymqffm4gsxlrhnq
                        bucket = test
                       tenancy = ocid1.tenancy.oc1..aaaaao6lmlzrvmk2x3uv7cglgxpan5ldsmq
                           key = true
                      proxy_on = true
                    proxy_host = www-proxy.us.example.com:80
                    proxy_user = 
                proxy_password = 
                        online = true
                            id = 77e3a201-b4e0-4a2c-9f9d-aee21eda9954
    Rules:
    NAME       ACTION       DAYS       ENABLED
    rule-000   archive      1          true
    
  3. You can perform the following tasks for lifecycle rules:
    • Create a rule.

      hostname:configuration services cloud target-000> rule
      hostname:configuration services cloud target-000 rule (uncommitted)> set action=delete
      action = delete
      hostname:configuration services cloud target-000 rule (uncommitted)> set duration=30days
      duration = 1 month
      hostname:configuration services cloud target-000 rule (uncommitted)> commit
      
    • List an existing rule.

      hostname:configuration services cloud target-000 rule-000> ls 
      Properties:
              action = archive
            duration = 1 day
             enabled = true
      
    • Modify a rule.

      hostname:configuration services cloud target-000 rule-000> set duration=30days
       
      duration = 1 month
      hostname:configuration services cloud target-000 rule-000> commit
    • Destroy a rule.

      hostname:configuration services cloud target-000> ls
      Properties:
      name = pl-34147888-b
      ...
      id = 092etfe9-b239-4688-a416-a419fe9efb
      Rules:
      NAME       ACTION    DAYS    ENABLED
      rule-000   archive    1      true
      rule-001   delete    30      true
      
      hostname:configuration services cloud target-000> destroy rule-001
      This will destroy "rule-001". Are you sure? (Y/N) y