Files
doc-exports/docs/obs/tool-obsutil/obs_11_0018.html
weihongmin1 a41a4e0331 OBS Util 0115 Version
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com>
Co-authored-by: weihongmin1 <weihongmin1@huawei.com>
Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
2026-02-17 10:18:57 +00:00

299 lines
38 KiB
HTML

<a name="obs_11_0018"></a><a name="obs_11_0018"></a>
<h1 class="topictitle1">Downloading an Object</h1>
<div id="body1543219047038"><div class="section" id="obs_11_0018__section1479112110815"><h4 class="sectiontitle">Function</h4><p id="obs_11_0018__p138646505217">You can use this command to download an object or download objects in batches by object name prefix to your local PC.</p>
<div class="notice" id="obs_11_0018__note780411406113"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="obs_11_0018__ul562142691216"><li id="obs_11_0018__li156218269126">Do not change the source objects in the OBS bucket when downloading a single object or objects in batches. Otherwise, the download may fail or data may be inconsistent.</li></ul>
</div></div>
</div>
<div class="section" id="obs_11_0018__section19587175622519"><h4 class="sectiontitle">Command Line Structure</h4><ul id="obs_11_0018__ul4348115485212"><li id="obs_11_0018__li034819548529">In Windows<ul id="obs_11_0018__ul14371109125314"><li id="obs_11_0018__li645116618536">Downloading a single object<pre class="screen" id="obs_11_0018__screen2021764195319">obsutil cp obs://bucket/key file_or_folder_url [-tempFileDir=xxx] [-dryRun] [-u] [-vlength] [-vmd5] [-p=1] [-threshold=52428800] [-versionId=xxx] [-ps=auto] [-cpd=xxx][-fr] [-o=xxx] [-config=xxx] </pre>
</li><li id="obs_11_0018__li18337131475317">Downloading objects in batches<pre class="screen" id="obs_11_0018__screen15467124815533">obsutil cp obs://bucket[/key] folder_url -r [-tempFileDir=xxx] [-dryRun] [-f] [-flat] [-u] [-vlength] [-vmd5] [-j=1] [-p=1] [-threshold=52428800] [-ps=auto] [-include=*.xxx] [-exclude=*.xxx] [-timeRange=time1-time2] [-mf] [-o=xxx] [-cpd=xxx] [-config=xxx] </pre>
</li></ul>
</li><li id="obs_11_0018__li4476145885216">In Linux or macOS<ul id="obs_11_0018__ul10651133045317"><li id="obs_11_0018__li252718313536">Downloading a single object<pre class="screen" id="obs_11_0018__screen970919582539">./obsutil cp obs://bucket/key file_or_folder_url [-tempFileDir=xxx] [-dryRun] [-u] [-vlength] [-vmd5] [-p=1] [-threshold=52428800] [-versionId=xxx] [-ps=auto] [-cpd=xxx] [-fr] [-o=xxx] [-config=xxx] </pre>
</li><li id="obs_11_0018__li952883111532">Downloading objects in batches<pre class="screen" id="obs_11_0018__screen2398117135418">./obsutil cp obs://bucket[/key] folder_url -r [-tempFileDir=xxx] [-dryRun] [-f] [-flat] [-u] [-vlength] [-vmd5] [-j=1] [-p=1] [-threshold=52428800] [-ps=auto] [-include=*.xxx] [-exclude=*.xxx] [-timeRange=time1-time2] [-mf] [-o=xxx] [-cpd=xxx] [-config=xxx] </pre>
</li></ul>
</li></ul>
</div>
<div class="section" id="obs_11_0018__section61282320386"><h4 class="sectiontitle">Examples</h4><ul id="obs_11_0018__ul161281934388"><li id="obs_11_0018__li81281030385">Take the Windows OS as an example. Run the <strong id="obs_11_0018__b73482127375">obsutil cp obs://bucket-test/key</strong> <strong id="obs_11_0018__b11350312103713">d:\temp\test.txt</strong> command to download a single object.<pre class="screen" id="obs_11_0018__screen1612812353810"><strong id="obs_11_0018__b17128123133817">obsutil cp obs://bucket-test/key</strong> <strong id="obs_11_0018__b14128153143814">d:\temp\test.txt</strong>
Start at 2024-09-30 08:39:34.180766 +0000 UTC
Parallel: 5 Jobs: 5
Threshold: 50.00MB PartSize: auto
VerifyLength: false VerifyMd5: false
CheckpointDir: xxxx
TempFileDir: xxxx
[==========================================] 100.00% 4.86 KB/s 8.46MB/8.46MB 0s
Download successfully, 8.46MB, obs://bucket-test/key --&gt; d:\temp\test.txtt, cost [41], status [200], request id [000001924215BEC84019EDF4044A5451]</pre>
</li></ul>
<ul id="obs_11_0018__ul312917315381"><li id="obs_11_0018__li012910317381">Take the Windows OS as an example. Run the <strong id="obs_11_0018__b1837091253712">obsutil cp obs://bucket-test/temp d:\ -f -r</strong> command to download objects in batches.<pre class="screen" id="obs_11_0018__screen1212913133818"><strong id="obs_11_0018__b191293323811">obsutil cp obs://bucket-test/temp <strong id="obs_11_0018__b612916318383">d:\</strong> -f -r</strong>
Start at 2024-09-30 08:41:56.0306522 +0000 UTC
Parallel: 5 Jobs: 5
Threshold: 50.00MB PartSize: auto
VerifyLength: false VerifyMd5: false
CheckpointDir: xxxx
Task id: 3066a4b0-4d21-4929-bb84-4829c32cbd0f
OutputDir: xxxx
TempFileDir: xxxx
[======================================================] 100.00% tps:17.86 155.59 KB/s 7.20MB/7.20MB 0s
Succeed count: 6 Failed count: 0
Succeed bytes: 70B
Metrics [max cost:153 ms, min cost:129 ms, average cost:92.00 ms, average tps:70, transferred size: 7.20MB]
Task id: 3066a4b0-4d21-4929-bb84-4829c32cbd0f</pre>
</li></ul>
<ul id="obs_11_0018__ul1312915303810"><li id="obs_11_0018__li5129173203813">For more examples, see <a href="obs_11_0027.html">Common Examples</a>.</li></ul>
</div>
<div class="section" id="obs_11_0018__section175878561255"><h4 class="sectiontitle">Parameter Description</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_11_0018__table1155454517538" frame="border" border="1" rules="all"><thead align="left"><tr id="obs_11_0018__row6558154516531"><th align="left" class="cellrowborder" valign="top" width="17.17171717171717%" id="mcps1.3.4.2.1.4.1.1"><p id="obs_11_0018__p1656117451534">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="26.26262626262626%" id="mcps1.3.4.2.1.4.1.2"><p id="obs_11_0018__p155651545195310">Optional or Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="56.56565656565656%" id="mcps1.3.4.2.1.4.1.3"><p id="obs_11_0018__p165678456530">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_11_0018__row756944516535"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p85701245145318">file_or_folder_url</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p457314555313">Mandatory for downloading an object</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p4573114555313">The local file/folder path</p>
</td>
</tr>
<tr id="obs_11_0018__row195751145115315"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p1576945115318">folder_url</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p75772453537">Mandatory for downloading objects in batches</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p12579194519531">The local folder path</p>
</td>
</tr>
<tr id="obs_11_0018__row1157912451534"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p058211459536">bucket</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p5582164575310">Mandatory</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p158414515316">The bucket name</p>
</td>
</tr>
<tr id="obs_11_0018__row1584114513535"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p17585144585310">key</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p10783112824619">Mandatory for downloading an object</p>
<p id="obs_11_0018__p19201728661">Optional for downloading objects in a batch</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p0588134575318">The name of the object to be downloaded, or the name prefix of the objects to be downloaded in batches</p>
<p id="obs_11_0018__p10591154565315">This parameter cannot be left blank when downloading an object. The saving and naming rules are as follows:</p>
<ul id="obs_11_0018__ul105928456532"><li id="obs_11_0018__li18704181916135">If this parameter specifies a file or folder path that does not exist, the tool checks whether the value ends with a slash (/) or backslash (\). If yes, a folder is created based on the path, and the object is downloaded to this newly created directory.</li><li id="obs_11_0018__li1230573911153">If this parameter specifies a file or folder path that does not exist and the value does not end with a slash (/) or backslash (\), the object is downloaded to your local PC with the value of <strong id="obs_11_0018__b39171932103717">key</strong> as the file name.</li><li id="obs_11_0018__li4953132119137">If this parameter specifies an existing file, the object is downloaded to your local PC overwriting the existing file, with the value of <strong id="obs_11_0018__b1581145618414">key</strong> as the file name.</li><li id="obs_11_0018__li1759284518535">If this parameter specifies an existing folder, the object is downloaded to the directory specified by <strong id="obs_11_0018__b18142520175817">file_or_folder_url</strong> with the object name as the file name.</li></ul>
<p id="obs_11_0018__p115612190125">During batch download, the saving rules are as follows:</p>
<ul id="obs_11_0018__ul15158191991211"><li id="obs_11_0018__li206451343181313">If this parameter is left blank, all objects in the bucket are downloaded to the directory specified by <strong id="obs_11_0018__b19288175202813">folder_url</strong>.</li><li id="obs_11_0018__li171587195121">If this parameter is configured, objects whose name prefix is the configured value in the bucket are downloaded to the directory specified by <strong id="obs_11_0018__b202481059123017">folder_url</strong>.</li></ul>
<div class="note" id="obs_11_0018__note14528254193716"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="obs_11_0018__ul54182557214"><li id="obs_11_0018__li104859352371">If this parameter is configured but the <strong id="obs_11_0018__b25692434515">flat</strong> parameter is not configured when downloading objects in a batch, the name of the downloaded file contains the name prefix of the parent object. If <strong id="obs_11_0018__b80195614562">flat</strong> is configured, then the name of the downloaded file does not contain the name prefix of the parent object.</li><li id="obs_11_0018__li17418185519218">For details about how to use this parameter, see <a href="obs_11_0029.html">Download</a>.</li></ul>
</div></div>
</td>
</tr>
<tr id="obs_11_0018__row1314444315116"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p123051451513">fr</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p113071451811">Optional for downloading an object (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p73101351816">Generates an operation result file when downloading an object.</p>
</td>
</tr>
<tr id="obs_11_0018__row20942144811418"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p1633845116148">flat</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p43401151111418">Optional for downloading objects in batches (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p2343205119145">The name prefix of the parent object is excluded when downloading objects in batches.</p>
</td>
</tr>
<tr id="obs_11_0018__row1163113812718"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p276284012715">tempFileDir</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p122055912103">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p1476264014710">The directory for storing temporary files during multipart download. The default value is the value of <strong id="obs_11_0018__b19183455528">defaultTempFileDir</strong> in the configuration file.</p>
<div class="note" id="obs_11_0018__note18655347142618"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="obs_11_0018__ul15994748142619"><li id="obs_11_0018__li55491537191019">If this parameter is left blank and the <strong id="obs_11_0018__b1049928913">defaultTempFileDir</strong> parameter in the configuration file is also left blank, temporary files generated during multipart download are saved in the directory where to-be-downloaded files are located and end with the suffix of <strong id="obs_11_0018__b1054316270311">.obs.temp</strong>.</li><li id="obs_11_0018__li49941648132611">Temporary files generated during multipart download are stored in this directory. Therefore, ensure that the user who executes obsutil has the write permission on the path.</li><li id="obs_11_0018__li999594822612">The available space of the partition where the path is located must be greater than the size of the objects to be downloaded.</li></ul>
</div></div>
</td>
</tr>
<tr id="obs_11_0018__row1525855205616"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p1537517155414">dryRun</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p13376216548">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p1137981175411">Conducts a dry run.</p>
</td>
</tr>
<tr id="obs_11_0018__row35998457538"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p206001459530">u</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p10601174595317">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p1260204518534">Indicates incremental download. If this parameter is set, each object can be downloaded only when it does not exist in the local path, its size is different from the namesake one in the local path, or it has the latest modification time.</p>
</td>
</tr>
<tr id="obs_11_0018__row9603194595311"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p1605745105311">vlength</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p12605114512534">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p1660724595316">Checks whether the sizes of the local files are the same as those of the objects in the bucket after the download is complete.</p>
</td>
</tr>
<tr id="obs_11_0018__row360812456535"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p136091945105315">vmd5</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p461011452539">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p19611745185310">Checks whether MD5 values of the local files are the same as those of the objects in the bucket after the download is complete.</p>
<div class="note" id="obs_11_0018__note2303131110278"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="obs_11_0018__p12303311112719">Objects in the bucket must contain metadata <strong id="obs_11_0018__b389818250123">x-obs-meta-md5chksum</strong>, or MD5 verification will be skipped.</p>
</div></div>
<div class="caution" id="obs_11_0018__note183475244419"><span class="cautiontitle"> CAUTION: </span><div class="cautionbody"><p id="obs_11_0018__p98341052114418">If your object needs encryption, do not use this parameter.</p>
</div></div>
</td>
</tr>
<tr id="obs_11_0018__row36131445115310"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p14613194514535">p</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p15615164515317">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p1161744513534">The maximum number of concurrent multipart download tasks when downloading an object. The default value is the value of <strong id="obs_11_0018__b18251123671818">defaultParallels</strong> in the configuration file.</p>
</td>
</tr>
<tr id="obs_11_0018__row14617144520537"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p17619545185314">threshold</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p9620645185311">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p262174575315">Indicates the threshold for enabling multipart download, in bytes. The default value is the value of <strong id="obs_11_0018__b86361877420">defaultBigfileThreshold</strong> in the configuration file.</p>
<div class="note" id="obs_11_0018__note94444118613"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="obs_11_0018__ul182059695115"><li id="obs_11_0018__li1320515655118">If the size of the object to be downloaded is smaller than the threshold, download the object directly. If not, a multipart download is required.</li><li id="obs_11_0018__li1651511123516">If you download an object directly, no part record is generated, and resumable transmission is not supported.</li><li id="obs_11_0018__li1184794414422">This parameter value can contain a unit, for example, <strong id="obs_11_0018__b55391717125111">1MB</strong> (indicating 1,048,576 bytes).</li></ul>
</div></div>
</td>
</tr>
<tr id="obs_11_0018__row136222045105310"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p122913325265">versionId</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p1662574595317">Optional for downloading an object (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p662724555310">The source object version ID that can be specified when downloading an object</p>
</td>
</tr>
<tr id="obs_11_0018__row1363634595315"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p3637164545318">ps</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p1264164517532">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p10641184516531">The size of each part in a multipart download task, in bytes. The default value is the value of <strong id="obs_11_0018__b1530220454436">defaultPartSize</strong> in the configuration file.</p>
<div class="note" id="obs_11_0018__note1175045524310"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="obs_11_0018__ul230316596421"><li id="obs_11_0018__li153031459184220">This parameter value can contain a unit, for example, <strong id="obs_11_0018__b5620112115118">1MB</strong> (indicating 1,048,576 bytes).</li><li id="obs_11_0018__li144561220153810">The parameter can be set to <strong id="obs_11_0018__b5916847154318">auto</strong>. In this case, obsutil automatically sets the part size for each multipart task based on the source object size.</li></ul>
</div></div>
</td>
</tr>
<tr id="obs_11_0018__row196461145155314"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p1764874511530">cpd</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p206482455537">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p1965018458536">The folder where the part records reside. The default value is <strong id="obs_11_0018__b1239112918205">.obsutil_checkpoint</strong>, the subfolder in the home directory of the user who executes obsutil commands.</p>
<div class="note" id="obs_11_0018__note519835512711"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="obs_11_0018__p118866577266">A part record is generated during a multipart download and saved to the <strong id="obs_11_0018__b1575171113474">down</strong> subfolder. After the download succeeds, its part record is deleted automatically. If the download fails or is suspended, the system attempts to resume the task according to its part record when you perform the download the next time.</p>
</div></div>
</td>
</tr>
<tr id="obs_11_0018__row1165094575317"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p96521245195311">r</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p7654154512534">Mandatory for downloading objects in batches (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p206552045145317">Copies objects in batches based on a specified object name prefix.</p>
</td>
</tr>
<tr id="obs_11_0018__row5655184520536"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p56577450535">f</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p13658645125314">Optional for downloading objects in batches (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p566014515533">Runs in force mode.</p>
</td>
</tr>
<tr id="obs_11_0018__row1566014510533"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p3662204585313">j</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p19305175612615">Optional for downloading objects in batches (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p17665114555311">The maximum number of concurrent tasks for downloading objects in a batch. The default value is the value of <strong id="obs_11_0018__b27577263238">defaultJobs</strong> in the configuration file.</p>
<div class="note" id="obs_11_0018__note891964620819"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="obs_11_0018__p1091964618820">The value is ensured to be greater than or equal to 1.</p>
</div></div>
</td>
</tr>
<tr id="obs_11_0018__row109762261097"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p156173113915">exclude</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p1930885652611">Optional for downloading objects in batches (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p16666614131519">The matching patterns of source objects that are excluded, for example, <strong id="obs_11_0018__b14546165310472">*.txt</strong></p>
<div class="note" id="obs_11_0018__note145284716208"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="obs_11_0018__ul05604713204"><li id="obs_11_0018__li14580477208">The asterisk (*) represents any group of characters, and the question mark (?) represents any single character. For instance, <strong id="obs_11_0018__b68461455154720">abc*.txt</strong> indicates any file whose name starts with <strong id="obs_11_0018__b0847175564713">abc</strong> and ends with <strong id="obs_11_0018__b11848125564714">.txt</strong>.</li><li id="obs_11_0018__li10293181913349">You can use <strong id="obs_11_0018__b1894173812108">\*</strong> to represent <strong id="obs_11_0018__b689573881013">*</strong> and <strong id="obs_11_0018__b2089518388106">\?</strong> to represent <strong id="obs_11_0018__b1789683815103">?</strong>.</li><li id="obs_11_0018__li20603473203">If the name of the object to be downloaded matches the value of this parameter, the object is skipped.</li></ul>
</div></div>
<div class="notice" id="obs_11_0018__note179117549207"><span class="noticetitle"> NOTICE: </span><div class="noticebody"><ul id="obs_11_0018__ul877892116516"><li id="obs_11_0018__li1517310321518">You are advised to use quotation marks for the matching pattern to prevent special characters from being escaped by the OS and leading to unexpected results. Use single quotation marks for Linux or macOS and double quotation marks for Windows.</li><li id="obs_11_0018__li1371214438918">The matching pattern applies to the absolute path of an object, including the object name prefix and object name starting from the root directory. For example, if the path of an object in the bucket is <strong id="obs_11_0018__b8572151512274">obs://bucket/src1/src2/test.txt</strong>, then the absolute path of the object is <strong id="obs_11_0018__b9573115102713">src1/src2/test.txt</strong>.</li><li id="obs_11_0018__li1148165015513">This matching pattern applies only to objects whose names do not end with a slash (/).</li><li id="obs_11_0018__li5291112193110">Multiple <strong id="obs_11_0018__b781994645114">exclude</strong> parameters can be specified, for example, <strong id="obs_11_0018__b19882163117512">-exclude=*.xxx -exclude=*.xxx</strong>.</li></ul>
</div></div>
</td>
</tr>
<tr id="obs_11_0018__row20666154513530"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p186661845145315">include</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p966784516533">Optional for downloading objects in batches (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p37071730153119">Specifies what formats of objects can be downloaded. If this parameter is set to <strong id="obs_11_0018__b96815203277">*.jpg</strong>, only objects in the <strong id="obs_11_0018__b54113373356">.jpg</strong> format can be downloaded.</p>
<div class="note" id="obs_11_0018__note195168716220"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="obs_11_0018__ul752013715229"><li id="obs_11_0018__li135211772221">The asterisk (*) represents any group of characters, and the question mark (?) represents any single character.</li><li id="obs_11_0018__li151801324163419">You can use <strong id="obs_11_0018__b96364102108">\*</strong> to represent <strong id="obs_11_0018__b136376101104">*</strong> and <strong id="obs_11_0018__b2638710121019">\?</strong> to represent <strong id="obs_11_0018__b1263991081017">?</strong>.</li><li id="obs_11_0018__li201739642420">Only after identifying that the name of the file to be downloaded does not match the value of <strong id="obs_11_0018__b14699101251018">exclude</strong>, the system checks whether the file name matches the value of this parameter. If yes, the file is downloaded. If not, the file is skipped.</li></ul>
</div></div>
<div class="notice" id="obs_11_0018__note9270217202212"><span class="noticetitle"> NOTICE: </span><div class="noticebody"><ul id="obs_11_0018__ul1329413124584"><li id="obs_11_0018__li14294512115812">You are advised to use quotation marks for the matching pattern to prevent special characters from being escaped by the OS and leading to unexpected results. Use single quotation marks for Linux or macOS and double quotation marks for Windows.</li><li id="obs_11_0018__li5744647391">The matching pattern applies to the absolute path of an object, including the object name prefix and object name starting from the root directory. For example, if the path of an object in the bucket is <strong id="obs_11_0018__b14412319182712">obs://bucket/src1/src2/test.txt</strong>, then the absolute path of the object is <strong id="obs_11_0018__b14412121942719">src1/src2/test.txt</strong>.</li><li id="obs_11_0018__li19166484914">This matching pattern applies only to objects whose names do not end with a slash (/).</li><li id="obs_11_0018__li1635081043119">Multiple <strong id="obs_11_0018__b3341521513">include</strong> parameters can be specified, for example, <strong id="obs_11_0018__b108056474514">-include=*.xxx -include=*.xxx</strong>.</li></ul>
</div></div>
</td>
</tr>
<tr id="obs_11_0018__row949610111431"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p496314014481">timeRange</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p1664510223494">Optional for downloading objects in batches (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p16963940134813">The time range matching pattern when downloading objects. Only objects whose latest modification time is within the configured time range are downloaded.</p>
<p id="obs_11_0018__p338461155315">This pattern has a lower priority than the object matching patterns (<strong id="obs_11_0018__b239512331936">exclude</strong>/<strong id="obs_11_0018__b33978336316">include</strong>). That is, the time range matching pattern is executed after the configured object matching patterns.</p>
<div class="note" id="obs_11_0018__note8766915165919"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="obs_11_0018__ul19272430145915"><li id="obs_11_0018__li12731730115918">The matching time range is represented in <em id="obs_11_0018__i7149142272719">time1</em><strong id="obs_11_0018__b17149422192717">-</strong><em id="obs_11_0018__i8149162242711">time2</em>, where <em id="obs_11_0018__i61506224276">time1</em> must be earlier than or the same as <em id="obs_11_0018__i201501622202716">time2</em>. The time format is <em id="obs_11_0018__i4151722102717">yyyyMMddHHmmss</em>.</li><li id="obs_11_0018__li32731530185916">Automatic formatting is supported. For example, yyyyMMdd is equivalent to yyyyMMdd000000, and yyyyMM is equivalent to yyyyMM01000000.</li><li id="obs_11_0018__li5185481610">If this parameter is set to <strong id="obs_11_0018__b1156152520273">*-</strong><em id="obs_11_0018__i856132562720">time2</em>, all files whose latest modification time is earlier than <em id="obs_11_0018__i857132511273">time2</em> are matched. If it is set to <em id="obs_11_0018__i205812582712">time1</em><strong id="obs_11_0018__b559225112719">-*</strong>, all files whose latest modification time is later than <em id="obs_11_0018__i15608259273">time1</em> are matched.</li></ul>
</div></div>
<div class="notice" id="obs_11_0018__note1078981817591"><span class="noticetitle"> NOTICE: </span><div class="noticebody"><ul id="obs_11_0018__ul881073612597"><li id="obs_11_0018__li1740024105917">Time in the matching pattern is the UTC time.</li><li id="obs_11_0018__li58105368598">This matching pattern applies only to objects whose names do not end with a slash (/).</li></ul>
</div></div>
</td>
</tr>
<tr id="obs_11_0018__row1116705416719"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p10122175516">mf</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p1562018121550">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p31226718512">Indicates that the name matching pattern (<strong id="obs_11_0018__b4613559637">include</strong> or <strong id="obs_11_0018__b561319593313">exclude</strong>) and the time matching pattern (<strong id="obs_11_0018__b86141759132">timeRange</strong>) also take effect on objects whose names end with a slash (/).</p>
<p id="obs_11_0018__p15797105118514"></p>
</td>
</tr>
<tr id="obs_11_0018__row109093549288"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p143226572287">o</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p232405732811">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p1632615718282">The folder that stores the result files. After the command is executed, result files (possibly success, failure, and warning files) will be created in the specified folder. The default value is <strong id="obs_11_0018__b1274019468201">.obsutil_output</strong>, a subfolder in the user's home directory where obsutil commands are executed.</p>
<div class="note" id="obs_11_0018__note1416817409247"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="obs_11_0018__ul101190347408"><li id="obs_11_0018__li111993418408">A result file should be named as follows: <strong id="obs_11_0018__b31361714249">cp_{succeed | failed | warning}_report_</strong><em id="obs_11_0018__i16135177241">time</em><strong id="obs_11_0018__b191421710246">_</strong><em id="obs_11_0018__i2014191717249">TaskId</em><strong id="obs_11_0018__b10141317152415">.txt</strong>.</li><li id="obs_11_0018__li412103664016">By default, the maximum size of a single result file is 30 MB and the maximum number of result files that can be retained is 1,024. You can set the maximum size and number by configuring <strong id="obs_11_0018__b1612152611242">recordMaxLogSize</strong> and <strong id="obs_11_0018__b7122526142416">recordBackups</strong> in the configuration file.</li><li id="obs_11_0018__li15478712034">If there are multiple folders and files and you need to confirm the details of a failed task, refer to the failure result file <strong id="obs_11_0018__obs_11_0013_b5396121718320">cp_failed_report_</strong><em id="obs_11_0018__obs_11_0013_i1639621714325">time</em><strong id="obs_11_0018__obs_11_0013_b1739631753215">_</strong><em id="obs_11_0018__obs_11_0013_i203979172328">TaskId</em><strong id="obs_11_0018__obs_11_0013_b1639718176326">.txt</strong> in the result folder and the <a href="obs_11_0056.html">log files</a> in the log path.</li></ul>
</div></div>
</td>
</tr>
<tr id="obs_11_0018__row0310840141812"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p114391014518">bucket-cname</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p4143210950">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p16143610251">The user-defined domain name bound to the bucket</p>
<div class="note" id="obs_11_0018__note16256574591"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="obs_11_0018__p172595719595">This parameter is only supported by obsutil 5.7.9 and later.</p>
</div></div>
</td>
</tr>
<tr id="obs_11_0018__row1920762633614"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p153951131317">config</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p12395135316">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__obs_11_0008_p1750111452317">The user-defined configuration file for executing the current command. For details about parameters that can be configured, see <a href="obs_11_0035.html">Configuration Parameters</a>.</p>
</td>
</tr>
<tr id="obs_11_0018__row10540102515220"><td class="cellrowborder" valign="top" width="17.17171717171717%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0018__p1966666191820">payer</p>
</td>
<td class="cellrowborder" valign="top" width="26.26262626262626%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0018__p1266611611820">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.56565656565656%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0018__p1166617619181">Specifies that requester pays is enabled.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_11_0018__section6926520122416"><h4 class="sectiontitle">Response</h4><p id="obs_11_0018__p21251255183018">Refer to <a href="obs_11_0013.html#obs_11_0013__section6926520122416">Response</a> for uploading an object.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_11_0012.html">Object Commands</a></div>
</div>
</div>