S3cmd
一:安装方法
#wget http://nchc.dl.sourceforge.net/project/s3tools/s3cmd/1.0.0/s3cmd-1.0.0.tar.gz
#tar -zxf s3cmd-1.0.0.tar.gz -C /usr/local/
#mv /usr/local/s3cmd-1.0.0/ /usr/local/s3cmd/
#ln -s /usr/local/s3cmd/s3cmd /usr/bin/s3cmd
二:使用方法
1.配置Access Key ID 和 Secret Access Key
#s3cmd --configure
2.列举所有的Buckets
#s3cmd ls
3.创建 bucket,且 bucket 名称是唯一的,不能重复。
#s3cmd mb s3://my-bucket-name
4.删除空 bucket
#s3cmd rb s3://my-bucket-name
5.列举 Bucket 中的内容
#s3cmd ls s3://my-bucket-name
6.上传 file.txt 到某个 bucket
#s3cmd put file.txt s3://my-bucket-name/file.txt
7.上传并将权限设置为所有人可读
#s3cmd put --acl-public file.txt s3://my-bucket-name/file.txt
8.批量上传文件
#s3cmd put ./* s3://my-bucket-name/
9.下载文件
#s3cmd get s3://my-bucket-name/file.txt file.txt
10.批量下载
#s3cmd get s3://my-bucket-name/* ./
11.删除文件
#s3cmd del s3://my-bucket-name/file.txt
12.来获得对应的bucket所占用的空间大小
#s3cmd du -H s3://my-bucket-name
三:文件夹处理规则
带"/"斜杠的 dir1,相当于上传yh目录下的所有文件,即类似 "cp ./* "
# s3cmd put -r yh s3://yaohong-bucket
upload: 'yh/1' -> 's3://yaohong-bucket/yh/1' [1 of 4]
0 of 0 0% in 0s 0.00 B/s done
upload: 'yh/2' -> 's3://yaohong-bucket/yh/2' [2 of 4]
0 of 0 0% in 0s 0.00 B/s done
upload: 'yh/3.py' -> 's3://yaohong-bucket/yh/3.py' [3 of 4]
0 of 0 0% in 0s 0.00 B/s done
upload: 'yh/3.sh' -> 's3://yaohong-bucket/yh/3.sh' [4 of 4]
0 of 0 0% in 0s 0.00 B/s done
四:同步方法
1.同步当前目录下所有文件
#s3cmd sync ./ s3://yaohong-bucket/
2.加 "--dry-run"参数后,仅列出需要同步的项目,不实际进行同步。
#s3cmd sync --dry-run ./ s3://my-bucket-name/
3.加 " --delete-removed"参数后,会删除本地不存在的文件。
#s3cmd sync --delete-removed ./ s3://my-bucket-name/
4.加 " --skip-existing"参数后,不进行MD5校验,直接跳过本地已存在的文件。
#s3cmd sync --skip-existing ./ s3://my-bucket-name/
高级同步
排除、包含规则(--exclude 、--include)
file1-1.txt被排除,file2-2.txt同样是txt格式却能被包含
# s3cmd sync --dry-run --exclude '*.txt' --include 'dir2/*' ./ s3://my-bucket-name/
exclude: dir1/file1-1.txt
upload: ./dir2/file2-2.txt -> s3://my-bucket-name/dir2/file2-2.txt
从文件中载入排除或包含规则。(--exclude-from、--include-from)
#s3cmd sync --exclude-from pictures.exclude ./ s3://my-bucket-name/
排除或包含规则支持正则表达式
--rexclude 、--rinclude、--rexclude-from、--rinclude-from
S3cmd的更多相关文章
- 使用s3cmd操作ceph rgw
安装1.sudo apt-get install -y python-pip sudo pip install s3cmd 2. sudo apt-get install s3cmd 配置 s3c ...
- 迅达云s3cmd客户端mac平台部署说明
自己根据文档整理了下,在这里记下,免得其他兄弟走弯路. 1 下载最新的s3cmd代码 https://github.com/s3tools/s3cmd/archive/master.zip 2 解压缩 ...
- s3cmd的安装与配置
安装包链接:http://files.cnblogs.com/files/litao0505/s3.rar 安装S3cmd1. tar -zxf s3cmd-1.0.0.tar.gz2. mv s3c ...
- s3cmd的安装与使用
s3cmd 是一款 Amazon S3 命令行工具.它不仅能上传.下载.同步,还能设置权限,下面是完整的安装使用指南. 主要是还是用来储存日志文件或者其他什么资料. https://wangyan. ...
- ceph S3客户端操作--s3cmd
S3 client 访问ceph rgw 安装: yum install s3cmd 验证安装是否成功: $s3cmd --version s3cmd version 1.5.2 #表示安装成功 在c ...
- s3cmd用法总结
概述 S3是亚马逊AWS提供的简单存储服务(可以理解为有公网域名的大容量高可用存储) S3配合CloudFront服务可作为CDN使用,它提供多节点全球发布 安装 方法一: yum install s ...
- S3cmd命令行管理对象存储
我的使用步骤 cd /usr/ 目录 git clone https://github.com/jdcloud-cmw/s3cmd.git 下载文件 ln -s /usr/s3cmd/s3c ...
- s3cmd在配置后使用时提示ERROR: S3 error: 403 (InvalidAccessKeyId): The AWS Access Key Id you provided does not exist in our records.
自己新建的ceph环境,下载了s3cmd来做客户端,使用了s3cmd --configure配置后,在使用s3cmd ls可以查看到所有的bucket,但s3cmd ls s3://xxx 具体buc ...
- s3cmd : Add a config parameter to enable path-style bucket access 当ceph rgw使用域名时,需要支持 path-style bucket特性
s3cmd 要是1.6.1 之后的版本 增加配置项: vi .s3cfg use_path_mode = True 源码参考: cat /usr/local/lib/python2.7/dist- ...
- s3cmd安装
配置yum.repos cd /etc/yum.repos.d/ vim s3tools.repo [s3tools] name=Tools for managing Amazon S3 - Simp ...
随机推荐
- [LeetCode] 62. Unique Paths 唯一路径
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The ...
- [LeetCode] 291. Word Pattern II 词语模式 II
Given a pattern and a string str, find if str follows the same pattern. Here follow means a full mat ...
- 最新 学霸君java校招面经 (含整理过的面试题大全)
从6月到10月,经过4个月努力和坚持,自己有幸拿到了网易雷火.京东.去哪儿.学霸君等10家互联网公司的校招Offer,因为某些自身原因最终选择了学霸君.6.7月主要是做系统复习.项目复盘.LeetCo ...
- Dotmemory 内存分析工具
Dotmemory 内存分析工具 教程一.开始学习dotmemory 在本教程中,我们将学习如何运行dotMemory内存快照.此外,我们将简要地看看dotMemory的用户界面和基本分析的概念.考虑 ...
- poj 2775 文件结构“图"
总时间限制: 1000ms 内存限制: 65536kB 描述 在计算机上看到文件系统的结构通常很有用.Microsoft Windows上面的"explorer"程序就是这样的一个 ...
- 问题二:appium 搞定权限弹框的一个小办法
public void permission() { for (int i=0; i <= 10; i++) { if (getPageSource().contains("允许&qu ...
- [转帖]Linux教程(13)- Linux中的通配符和正则表达式
Linux教程(13)- Linux中的通配符和正则表达式 2018-08-22 06:16:44 钱婷婷 阅读数 39更多 分类专栏: Linux教程与操作 Linux教程与使用 版权声明:本文 ...
- sql查询出现1055 this is incompatible with sql_mode=only_full_group_by
今天在测试服务器上突然出现了这么一个MySQL的问题,同样的代码正式服没有问题,那肯定就是出在了配置上,查了一下原因才明白原来是数据库版本为5.7以上的版本, 默认是开启了 only_full_gro ...
- Spring全家桶注解一览(精选)
废话 最近想整理一波Spring注解相关的文章,虽然写CURD就只涉及到那些常用的注解.但是笔者我也想去了解一下其他注解,丰富下自己的知识面(提升一下逼格!). 就想在网上搜了半天,好像大家的都差不多 ...
- windows10环境下的RabbitMQ使用_笔记
使用默认账号:guest/guest登录http://localhost:15672/#/进去,添加一个新用户(Administrator权限),并设置其Permission 新建两个控制台程序 安装 ...