cc_staff
172
edits
No edit summary |
No edit summary |
||
Line 58: | Line 58: | ||
<code>$ s3cmd info s3://BUCKET_NAME/</code> | <code>$ s3cmd info s3://BUCKET_NAME/</code> | ||
The output will look something like this: | |||
<pre> | |||
s3://BUCKET_NAME/ (bucket): | |||
Location: default | |||
Payer: BucketOwner | |||
Expiration Rule: none | |||
Policy: none | |||
CORS: none | |||
ACL: *anon*: READ | |||
ACL: USER: FULL_CONTROL | |||
URL: http://object-arbutus.cloud.computecanada.ca/BUCKET_NAME/ | |||
</pre> | |||
=== Upload files === | === Upload files === | ||
To upload a file to the bucket, use the command: | To upload a file to the bucket, use the <code>put</code> command similar to this: | ||
<code>$ s3cmd put --guess-mime-type FILE_NAME.dat s3://BUCKET_NAME/FILE_NAME.dat</code> | <code>$ s3cmd put --guess-mime-type FILE_NAME.dat s3://BUCKET_NAME/FILE_NAME.dat</code> | ||
Where the bucket name and the file name are specified. Multipurpose Internet Mail Extensions (MIME) is a mechanism for handling files. 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>. | |||
=== ACLs and Policies === | |||
Buckets can have Access Control Lists (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 Access Control Lists (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. | ||
<code>$ s3cmd setacl --acl-public s3://BUCKET_NAME</code> | <code>$ s3cmd setacl --acl-public s3://BUCKET_NAME</code> | ||