日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

s3cmd安装配置及基础命令

發布時間:2023/12/20 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 s3cmd安装配置及基础命令 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、安裝

查看服務器版本,7以上可以直接配置好yum源安裝,6的需要用rpm包安裝
s3是S3是Simple Storage Service的縮寫,即簡單存儲服務,也可以說是云存儲,需要存儲端和客戶端

1、yum安裝

1、配置yum源

vim ceph.repo [ceph] name=ceph #baseurl=https://mirrors.aliyun.com/ceph/rpm-mimic/el7/x86_64/ baseurl=https://mirrors.aliyun.com/ceph/rpm-luminous/el7/x86_64/ gpgcheck=0[ceph-noarch] name=cephnoarch #baseurl=https://mirrors.aliyun.com/ceph/rpm-mimic/el7/noarch/ baseurl=https://mirrors.aliyun.com/ceph/rpm-luminous/el7/noarch/ gpgcheck=0 epel.repo [epel] name=Extra Packages for Enterprise Linux 7 - $basearch baseurl=http://mirrors.aliyun.com/epel/7/$basearch failovermethod=priority enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7[epel-debuginfo] name=Extra Packages for Enterprise Linux 7 - $basearch - Debug baseurl=http://mirrors.aliyun.com/epel/7/$basearch/debug failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=0[epel-source] name=Extra Packages for Enterprise Linux 7 - $basearch - Source baseurl=http://mirrors.aliyun.com/epel/7/SRPMS failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=0

2、yum install -y s3cmd
3、配置ceph和cllient
ceph是存儲設備,一般安裝好之后只需要妥善保管ak和sk信息
“access_key”:
“secret_key”: "
client是客戶端,安裝好之后配置存儲文件

/root/.s3cfg [default] access_key =ceph的ak access_token = add_encoding_exts = add_headers = bucket_location = US ca_certs_file = cache_file = check_ssl_certificate = True check_ssl_hostname = True cloudfront_host = cloudfront.amazonaws.com connection_max_age = 5 connection_pooling = True content_disposition = content_type = default_mime_type = binary/octet-stream delay_updates = False delete_after = False delete_after_fetch = False delete_removed = False dry_run = False enable_multipart = True encrypt = False expiry_date = expiry_days = expiry_prefix = follow_symlinks = False force = False get_continue = False gpg_command = /bin/gpg gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s gpg_passphrase = guess_mime_type = True host_base = IP:端口 host_bucket = IP:端口 human_readable_sizes = False invalidate_default_index_on_cf = False invalidate_default_index_root_on_cf = True invalidate_on_cf = False kms_key = limit = -1 limitrate = 0 list_md5 = False log_target_prefix = long_listing = False max_delete = -1 mime_type = multipart_chunk_size_mb = 500 multipart_copy_chunk_size_mb = 1024 multipart_max_chunks = 100000 preserve_attrs = True progress_meter = True proxy_host = proxy_port = 0 public_url_use_https = False put_continue = False recursive = False recv_chunk = 65536 reduced_redundancy = False requester_pays = False restore_days = 1 restore_priority = Standard secret_key = ceph的sk send_chunk = 65536 server_side_encryption = False signature_v2 = False signurl_use_https = False simpledb_host = sdb.amazonaws.com skip_existing = False socket_timeout = 300 ssl_client_cert_file = ssl_client_key_file = stats = False stop_on_error = False storage_class = throttle_max = 100 upload_id = urlencoding_mode = normal use_http_expect = False use_https = False use_mime_magic = True verbosity = WARNING website_endpoint = http://%(bucket)s.s3-website-%(location)s.amazonaws.com/ website_error = website_index = index.html max_concurrent_requests = 50

至此安裝完成

2、rpm安裝

1、下載
http://www.rpmfind.net/linux/rpm2html/search.php?query=s3cmd
wget

2、rmp -ivh 包
3、安裝ceph和client以及配置(和上面一樣)

二、簡單命令

首先他不是ftp,不可以在里面創建目錄,但是可以上傳目錄,所以如果需要多層目錄,請提前在本地創建好再上傳

操作命令說明
1.創建bucket
s3cmd mb s3://BUCKET
例子:創建一個名為test的bucket
s3cmd mb s3://test

2.刪除bucket
s3cmd rb s3://BUCKET
例子:刪除一個名為test的bucket
s3cmd mb s3://test

3.查看bucket/object下的內容
s3cmd ls [s3://BUCKET[/PREFIX]]

4.列出所有buckets下的object
s3cmd la

5.上傳文件
s3cmd put FILE [FILE…] s3://BUCKET[/PREFIX]
例子:上傳file111到test這個bucket
s3cmd put file111 s3://test/
如果上傳文件夾需要加+r
如上傳file222文件夾
s3cmd put -r file222 s3://test/

6.下載文件
s3cmd get s3://BUCKET/OBJECT LOCAL_FILE
如下載file111
s3cmd get s3://test/file111

7.刪除文件
s3cmd del s3://BUCKET/OBJECT
如刪除file111
s3cmd del s3://test/file111

其他命令可以通過man s3cmd查看

總結

以上是生活随笔為你收集整理的s3cmd安装配置及基础命令的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。