forked from docs/doc-exports
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com> Co-authored-by: weihongmin1 <weihongmin1@huawei.com> Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
41 lines
3.3 KiB
HTML
41 lines
3.3 KiB
HTML
<a name="obs_11_0046"></a><a name="obs_11_0046"></a>
|
|
|
|
<h1 class="topictitle1">Synchronous Upload</h1>
|
|
<div id="body1547791494081"><p id="obs_11_0046__p182110247282">All commands in this section use the Linux operating system as an example to describe how to perform synchronous upload operations.</p>
|
|
<p id="obs_11_0046__p1693019466342">Assume that a local folder is in the following structure:</p>
|
|
<pre class="screen" id="obs_11_0046__screen1426863513468"><span style="color:#666600;">└──</span> src1
|
|
<span style="color:#666600;"> ├──</span> src2
|
|
<span style="color:#666600;"> ├──</span> test1.txt
|
|
<span style="color:#666600;"> └──</span> test2.txt
|
|
<span style="color:#666600;">├──</span> src3
|
|
<span style="color:#666600;">└──</span> test3.txt</pre>
|
|
<p id="obs_11_0046__p4927118201719">Assume that bucket <strong id="obs_11_0046__b1560111110326">bucket-test</strong> contains the following objects:</p>
|
|
<pre class="screen" id="obs_11_0046__screen776818585566">obs://bucket-test/src1/
|
|
obs://bucket-test/src1/src2/
|
|
obs://bucket-test/src1/src2/test1.txt
|
|
obs://bucket-test/src1/src3/</pre>
|
|
<p id="obs_11_0046__p515421611454">Based on the structure of the preceding local folder and objects in the bucket, different synchronous upload scenarios require different commands.</p>
|
|
<ul id="obs_11_0046__ul20301195665415"><li id="obs_11_0046__li1430185695420">To synchronize the <strong id="obs_11_0046__b3966315103415">test3.txt</strong> file in the local <strong id="obs_11_0046__b496651513345">src1</strong> folder to the root directory of bucket <strong id="obs_11_0046__b6967191523418">bucket-test</strong>, the command is as follows:<pre class="screen" id="obs_11_0046__screen27011879554">./obsutil sync /src1/test3.txt obs://bucket-test</pre>
|
|
<p id="obs_11_0046__p8859716195520">After the synchronization is successful, the <strong id="obs_11_0046__b18473175185612">test3.txt</strong> file is directly uploaded to the bucket because there is no <strong id="obs_11_0046__b13839164763610">test3.txt</strong> in bucket <strong id="obs_11_0046__b185541919165513">bucket-test</strong>. Then, objects in the bucket are as follows:</p>
|
|
<pre class="screen" id="obs_11_0046__screen1677410173567">obs://bucket-test/test3.txt
|
|
obs://bucket-test/src1/
|
|
obs://bucket-test/src1/src2/
|
|
obs://bucket-test/src1/src2/test1.txt
|
|
obs://bucket-test/src1/src3/</pre>
|
|
</li><li id="obs_11_0046__li18460634165719">To synchronize all files and subfolders in the local <strong id="obs_11_0046__b951055515375">src1</strong> folder to the <strong id="obs_11_0046__b12511105512370">src1</strong> folder in bucket <strong id="obs_11_0046__b251215543718">bucket-test</strong>, the command is as follows:<pre class="screen" id="obs_11_0046__screen31021421101319">./obsutil sync /src1 obs://bucket-test/src1</pre>
|
|
<p id="obs_11_0046__p176731231101315">After the synchronization, the objects in the bucket are as follows:</p>
|
|
<pre class="screen" id="obs_11_0046__screen981772017300">obs://bucket-test/src1/
|
|
obs://bucket-test/src1/test3.txt
|
|
obs://bucket-test/src1/src2/
|
|
obs://bucket-test/src1/src2/test1.txt
|
|
obs://bucket-test/src1/src2/test2.txt
|
|
obs://bucket-test/src1/src3/</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_11_0027.html">Common Examples</a></div>
|
|
</div>
|
|
</div>
|
|
|