Overview
This article lists several commands you can use to manage your DreamObjects data. This article assumes you've already installed S3cmd:
If you're using a custom version of Python
The commands below work with the server version of Python. However, you may have installed a custom version of Python using the following article:
If so, you may see the following error when running the commands below.
ImportError trying to import dateutil.parser.
Please install the python dateutil module:
$ sudo apt-get install python-dateutil
or
$ sudo yum install python-dateutil
or
$ pip install python-dateutil
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!If so, you must create a virtual environment to install the python-dateutil package. You will then be able to use the commands below without error.
Make sure to log out of your SSH session and back in to ensure the new settings are active.
Creating
Making a bucket
[server]$ s3cmd mb s3://my-new-bucket
Bucket 's3://my-new-bucket/' createdListing
Listing all buckets
[server]$ s3cmd ls
2024-03-29 16:28 s3://my-bucketListing the contents of a bucket
[server]$ s3cmd ls s3://my-bucket
DIR s3://my-bucket/backups/
2024-03-29 18:09 11 s3://my-bucket/file1.txtListing the size of a bucket
[server]$ s3cmd du -H s3://my-bucket
40G s3://my-bucketUploading
Uploading a file into a bucket
[server]$ s3cmd put testfile.txt s3://my-bucket
file.txt -> s3://my-bucket/file.txt [1 of 1]
127 of 127 100% in 0s 1522.87 B/s doneDownloading
Downloading a file from a bucket
[server]$ s3cmd get s3://my-bucket/file.txt
s3://my-bucket/file.txt -> ./file.txt [1 of 1]
127 of 127 100% in 0s 3.46 kB/s doneDeleting
Deleting a file in a bucket
[server]$ s3cmd del s3://my-bucket/file.txt
File s3://my-bucket/file.txt deletedDeleting all Objects in a bucket
This will remove all Objects and empty the bucket.
[server]$ s3cmd del --recursive s3://my-bucket --force