Accessing object storage with s3cmd: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 16: Line 16:


<!--T:5-->
<!--T:5-->
To configure the <code>s3cmd</code> tool use the command:</br>
To configure the <code>s3cmd</code> tool, use the command:</br>
<code>$ s3cmd --configure</code>
<code>$ s3cmd --configure</code>


Line 73: Line 73:


== Create buckets == <!--T:15-->
== Create buckets == <!--T:15-->
The next task is to make a bucket.  Buckets contain files. Bucket names must be unique across the Arbutus object storage solution.  Therefore, you will need to create a uniquely named bucket which will not conflict with other users.  For example, buckets <tt>s3://test/</tt> and <tt>s3://data/</tt> are likely already taken.  Consider creating buckets reflective of your project, for example <tt>s3://def-test-bucket1</tt> or <tt>s3://atlas_project_bucket</tt>.  Valid bucket names may only use the upper case characters, lower case characters, digits, periods, hyphens, and underscores (i.e. A-Z, a-z, 0-9, ., -, and _ ).
The next task is to make a bucket.  Buckets contain files. Bucket names must be unique across the Arbutus object storage solution.  Therefore, you will need to create a uniquely named bucket which will not conflict with other users.  For example, buckets <code>s3://test/</code> and <code>s3://data/</code> are likely already taken.  Consider creating buckets reflective of your project, for example <code>s3://def-test-bucket1</code> or <code>s3://atlas_project_bucket</code>.  Valid bucket names may only use the upper case characters, lower case characters, digits, period, hyphen, and underscore (i.e. A-Z, a-z, 0-9, ., -, and _ ).


<!--T:16-->
<!--T:16-->
Line 110: Line 110:


<!--T:24-->
<!--T:24-->
Where the bucket name and the file name are specified.  Multipurpose Internet Mail Extensions (MIME) is a mechanism for handling files based on their type. The <code>--guess-mime-type</code> command parameter will guess the MIME type based on the file extension.  The default MIME type is <code>binary/octet-stream</code>.
where the bucket name and the file name are specified.  Multipurpose Internet Mail Extensions (MIME) is a mechanism for handling files based on their type. The <code>--guess-mime-type</code> command parameter will guess the MIME type based on the file extension.  The default MIME type is <code>binary/octet-stream</code>.


== Delete File == <!--T:25-->
== Delete files == <!--T:25-->
To delete a file from the bucket, use the  <code>rm</code> command similar to this:<br/>
To delete a file from the bucket, use the  <code>rm</code> command similar to this:<br/>
<code>$ s3cmd rm s3://BUCKET_NAME/FILE_NAME.dat</code>
<code>$ s3cmd rm s3://BUCKET_NAME/FILE_NAME.dat</code>


== Access Control Lists (ACLs) and Policies == <!--T:26-->
== Access control lists (ACLs) and policies == <!--T:26-->
Buckets can have ACLs and policies which govern who can access what resources in the object store.  These features are quite sophisticated.  Here are two simple examples of using ACLs using the tool's <code>setacl</code> command.
Buckets can have ACLs and policies which govern who can access what resources in the object store.  These features are quite sophisticated.  Here are two simple examples of using ACLs using the tool's <code>setacl</code> command.


rsnt_translations
56,420

edits

Navigation menu