forked from docs/doc-exports
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com> Co-authored-by: zhangyue <zhangyue164@huawei.com> Co-committed-by: zhangyue <zhangyue164@huawei.com>
47 lines
11 KiB
HTML
47 lines
11 KiB
HTML
<a name="obs_03_0335"></a><a name="obs_03_0335"></a>
|
|
|
|
<h1 class="topictitle1">Configuring a Lifecycle Rule</h1>
|
|
<div id="body1499753333227"><p id="obs_03_0335__p03824073820">You can configure a lifecycle rule for a bucket or a set of objects to:</p>
|
|
<ul id="obs_03_0335__ul1538263365117"><li id="obs_03_0335__li12382533195113">Transition objects from Standard to Warm or Cold.</li><li id="obs_03_0335__li16382153319516">Transition objects from Warm to Cold.</li><li id="obs_03_0335__li123821533115120">Expire objects and then delete them.</li></ul>
|
|
<p id="obs_03_0335__p10497142912222">Lifecycle rules do not transition Cold objects to other storage classes.</p>
|
|
<div class="section" id="obs_03_0335__section4422459618019"><h4 class="sectiontitle">Procedure</h4><ol id="obs_03_0335__ol409287161832"><li id="obs_03_0335__li99821455306"><span>In the bucket list, click the bucket you want to operate. The <strong id="obs_03_0335__obs_03_0307_b144421021120">Overview</strong> page is displayed.</span></li><li id="obs_03_0335__li18830181855820"><span>In the <strong id="obs_03_0335__b565584411338">Basic Configurations</strong> area, click <strong id="obs_03_0335__b1216512105344">Lifecycle Rules</strong>. The <strong id="obs_03_0335__b7670431173413">Lifecycle Rules</strong> page is displayed.</span><p><p id="obs_03_0335__p471425117139">Alternatively, you can choose <strong id="obs_03_0335__b353920571292">Basic Configurations</strong> > <strong id="obs_03_0335__b1979524171017">Lifecycle Rules</strong> in the navigation pane.</p>
|
|
</p></li><li id="obs_03_0335__li6653363119435"><span>Click <strong id="obs_03_0335__b175917481148">Create</strong>. A dialog box shown in <a href="#obs_03_0335__fig1529154319415">Figure 1</a> is displayed.</span><p><div class="fignone" id="obs_03_0335__fig1529154319415"><a name="obs_03_0335__fig1529154319415"></a><a name="fig1529154319415"></a><span class="figcap"><b>Figure 1 </b>Creating a lifecycle rule</span><br><span><img id="obs_03_0335__image11715124510230" src="en-us_image_0000001631360616.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
</p></li><li id="obs_03_0335__li39098515"><span>Configure a lifecycle rule.</span><p><div class="p" id="obs_03_0335__p5509517915252"><strong id="obs_03_0335__b264519183425">Basic Information</strong>:<ul id="obs_03_0335__ul16342320"><li id="obs_03_0335__li6267879315835"><strong id="obs_03_0335__b5881289715835">Status</strong>: <p id="obs_03_0335__p885822615835">Select <strong id="obs_03_0335__b19429790191407">Enable</strong> to enable the lifecycle rule.</p>
|
|
</li><li id="obs_03_0335__li5729884015841"><strong id="obs_03_0335__b2914155715841">Rule Name</strong>: <p id="obs_03_0335__p2310122815842">It identifies a lifecycle rule. A rule name can contain a maximum of 255 characters.</p>
|
|
</li><li id="obs_03_0335__li61432666143253"><strong id="obs_03_0335__b1443569572145115">Applies To</strong>: Can be set to <strong id="obs_03_0335__b948338085145115">Object name prefix</strong> or <strong id="obs_03_0335__b405387834145115">Bucket</strong>.<ul id="obs_03_0335__ul4702430145854"><li id="obs_03_0335__li34845172143258"><strong id="obs_03_0335__b194117256424">Object name prefix</strong>: Objects with this specified prefix will be managed by the lifecycle rule. The prefix cannot start with a slash (/) or contain two consecutive slashes (//), and cannot contain the following special characters: \:*?"<>|</li><li id="obs_03_0335__li43762555113418"><strong id="obs_03_0335__b261482711145141">Bucket</strong>: All objects in the bucket will be managed by the lifecycle rule.</li></ul>
|
|
</li></ul>
|
|
<div class="note" id="obs_03_0335__note35283025"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="obs_03_0335__ul49111773"><li id="obs_03_0335__li39352775">If the specified prefix is overlapping with the prefix set in an existing lifecycle rule, OBS regards these two rules as one and forbids you to configure the one you are configuring. For example, if there is already a rule with prefix <strong id="obs_03_0335__b54296197">abc</strong> in OBS, you cannot configure another rule whose prefix starts with <strong id="obs_03_0335__b18903728">abc</strong>.</li><li id="obs_03_0335__li18630656">If there is already a lifecycle rule based on an object prefix, you are not allowed to configure another rule that is applied to the entire bucket.</li><li id="obs_03_0335__li33458177">If a lifecycle rule has been configured for the entire bucket, no more rules that apply to object name prefix can be added.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
<p id="obs_03_0335__p4329302814373"><strong id="obs_03_0335__b1106642753145428">Current Version</strong> or <strong id="obs_03_0335__b49163472145428">Historical Version</strong>:</p>
|
|
<div class="note" id="obs_03_0335__note16805850"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="obs_03_0335__ul3456553515453"><li class="NotesText" id="obs_03_0335__li6309484515453"><strong id="obs_03_0335__b55775843115041">Current Version</strong> and <strong id="obs_03_0335__b10717756115044">Historical Version</strong> are two concepts for versioning. If versioning is enabled for a bucket, uploading objects with the same name to the bucket creates different object versions. The last uploaded object is called the current version, while those previously uploaded are called historical versions. </li><li id="obs_03_0335__li555179501550">You can configure either the <strong id="obs_03_0335__b1735055012614">Current Version</strong> or <strong id="obs_03_0335__b111680576617">Historical Version</strong>, or both of them.</li></ul>
|
|
</div></div>
|
|
<ul id="obs_03_0335__ul944841515351"><li id="obs_03_0335__li53535400204050"><strong id="obs_03_0335__b162314240584">Transition to Warm</strong>: After this number of days since the last update, objects meeting specified conditions will be transitioned to Warm. This number must be at least 30.</li><li id="obs_03_0335__li40553341204057"><strong id="obs_03_0335__b9401121715914">Transition to Cold</strong>: After this number of days since the last update, objects meeting specified conditions will be transitioned to Cold. If you configure to transition objects first to Warm and then Cold, the objects must stay Warm at least 30 days before they can be transitioned to Cold. If only transition to Cold is used, but transition to Warm is not, there is no limit on the number of days for transition.</li><li id="obs_03_0335__li3114893515420"><strong id="obs_03_0335__b185768348720">Delete Objects After (Days)</strong>: After this number of days since the last update, objects meeting certain conditions will be expired and then deleted. This number must be larger than that specified for any of the transition operations.</li></ul>
|
|
<div class="p" id="obs_03_0335__p50988061113345">For example, on January 7, 2015, you saved the following files in OBS:<ul id="obs_03_0335__ul466294043312"><li id="obs_03_0335__li28459613">log/test1.log</li><li id="obs_03_0335__li54809927">log/test2.log</li><li id="obs_03_0335__li23527303">doc/example.doc</li><li id="obs_03_0335__li10419141">doc/good.txt</li></ul>
|
|
</div>
|
|
<div class="MsoNormal" id="obs_03_0335__p26663410">On January 10, 2015, you saved another four files:<ul id="obs_03_0335__ul1877348103412"><li id="obs_03_0335__li12252614">log/clientlog.log</li><li id="obs_03_0335__li43164662">log/serverlog.log</li><li id="obs_03_0335__li52937641">doc/work.doc</li><li id="obs_03_0335__li19422124114310">doc/travel.txt</li></ul>
|
|
</div>
|
|
<p id="obs_03_0335__p513573918258">On January 10, 2015, you set the objects prefixed with <strong id="obs_03_0335__b1466203810337">log</strong> to expire one day later. You might encounter the following situations:</p>
|
|
<ul id="obs_03_0335__ul144381629142811"><li id="obs_03_0335__li343932952810">Objects <strong id="obs_03_0335__b86511511153712">log/test1.log</strong> and <strong id="obs_03_0335__b0309616103717">log/test2.log</strong> uploaded on January 7, 2015 might be deleted after the last system scan. The deletion could happen on January 10, 2015 or January 11, 2015, depending on the time of the last system scan.</li><li id="obs_03_0335__li49041356113017">Objects <strong id="obs_03_0335__b15317154311425">log/clientlog.log</strong> and <strong id="obs_03_0335__b93695478426">log/serverlog.log</strong> uploaded on January 10, 2015 might be deleted on January 11, 2015 or January 12, 2015, depending on whether they have been stored for over one day (since their last update) when the system scan happened.</li></ul>
|
|
<p id="obs_03_0335__p182057154316">On the day of operation, you can set the objects with the name prefix <strong id="obs_03_0335__b164031732111017">log</strong> to be transitioned to <strong id="obs_03_0335__b8404123211010">Warm</strong> 30 days later, transitioned to <strong id="obs_03_0335__b104045322101">Cold</strong> 60 days later, and deleted 100 days later, then OBS will transition <strong id="obs_03_0335__b8404123201014">log/clientlog.log</strong>, <strong id="obs_03_0335__b17404123211013">log/serverlog.log</strong>, <strong id="obs_03_0335__b340433291011">log/test1.log</strong>, and <strong id="obs_03_0335__b1940443211020">log/test2.log</strong> to <strong id="obs_03_0335__b20404133212104">Warm</strong> when their storage duration exceeds 30 days, transition them to <strong id="obs_03_0335__b11404183261014">Cold</strong> when their storage duration exceeds 60 days, and delete them when their storage duration exceeds 100 days, respectively.</p>
|
|
<div class="note" id="obs_03_0335__note8551937154317"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_03_0335__p1656615482483">In theory, it takes 24 hours at most to execute a lifecycle rule. Because OBS calculates the lifecycle of an object from the next 00:00 (UTC time) after the object is uploaded, there may be a delay in transitioning objects between storage classes and deleting expired objects. Generally, the delay does not exceed 48 hours. If you make changes to an existing lifecycle rule, the rule will take effect again.</p>
|
|
</div></div>
|
|
</p></li><li id="obs_03_0335__li56738760"><span>Click <strong id="obs_03_0335__b11589310155211">OK</strong> to complete the lifecycle rule configuration.</span></li></ol>
|
|
</div>
|
|
<div class="section" id="obs_03_0335__section1589011665116"><h4 class="sectiontitle">Follow-up Procedure</h4><p id="obs_03_0335__p441791955212">You can click <strong id="obs_03_0335__b5506483297">Edit</strong> in the <strong id="obs_03_0335__b950248142910">Operation</strong> column of a lifecycle rule to edit the rule. You can also click <strong id="obs_03_0335__b1450194892916">Disable</strong> or <strong id="obs_03_0335__b2501948142916">Enable</strong> to disable or enable it.</p>
|
|
<p id="obs_03_0335__p2714114510553">If you want to delete more than one lifecycle rule at a time, select them and click <strong id="obs_03_0335__b1954631191319">Delete</strong> above the list.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_03_0334.html">Lifecycle Management</a></div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script language="JavaScript">
|
|
<!--
|
|
image_size('.imgResize');
|
|
var msg_imageMax = "view original image";
|
|
var msg_imageClose = "close";
|
|
//--></script> |