swift 命令行
来源:互联网 发布:淘宝少儿坎肩演出服装 编辑:程序博客网 时间:2024/05/16 10:15
也是先source用户和租间
1、查看容器和存储的对象
[root@localhost ~(keystone_admin)]# swift list[root@localhost ~(keystone_admin)]# swift list --lh 0 0$ swift list $container #显示某个容器的对象信息2、查看状态信息
[root@localhost ~(keystone_admin)]# swift stat Account: AUTH_9387b24331da4daebac32a8ccd52dd4bContainers: 0 Objects: 0 Bytes: 0Content-Type: text/plain; charset=utf-8X-Timestamp: 1384944092.11535X-Put-Timestamp: 1384944092.115353、创建容器
[root@localhost ~(keystone_admin)]# swift post test[root@localhost ~(keystone_admin)]# swift list --lh 0 0 2013-11-20 10:42:16 test 0 0
4、删除容器
[root@localhost ~(keystone_admin)]# swift delete test[root@localhost ~(keystone_admin)]# swift list --lh 0 0$swift delete $container $object#删除某个容器里的某个对象5、上传对象a、先创建个文件500M的
[root@localhost ~(keystone_admin)]# dd if=/dev/zero of=/tmp/example-500Mb bs=1M count=500记录了500+0 的读入记录了500+0 的写出524288000字节(524 MB)已复制,0.258867 秒,2.0 GB/秒b、上传到刚才创建的容器”test“中[root@localhost ~(keystone_admin)]# swift upload test /tmp/example-500Mb tmp/example-500Mb支持目录和多个文件swift upload $container $dirswift upload $container file1 file2 ..6、上传大文件时,可以用-S来分片(s for segment)
[root@localhost ~(keystone_admin)]# swift upload test -S 102400000 /tmp/example-500Mb tmp/example-500Mb segment 5tmp/example-500Mb segment 0tmp/example-500Mb segment 2tmp/example-500Mb segment 1tmp/example-500Mb segment 4tmp/example-500Mb segment 3tmp/example-500Mb最终,文件对象会上传到"test"容器中,但也会增加一个“test_segments”的容器,里面放的就是文件分片时产生的各个小分片文件。[root@localhost ~(keystone_admin)]# swift list --lh 2 43 2013-11-20 10:42:16 test 6 500M 2013-11-21 02:31:52 test_segments[root@localhost ~(keystone_admin)]# swift list test --lh 0 2013-11-21 02:41:32 tmp/example-500Mb 43 2013-11-20 11:02:37 tmp/test.txt 43[root@localhost ~(keystone_admin)]# swift list test_segments --lh 97M 2013-11-21 02:41:30 tmp/example-500Mb/1384944751.119769/524288000/102400000/00000000 97M 2013-11-21 02:41:30 tmp/example-500Mb/1384944751.119769/524288000/102400000/00000001 97M 2013-11-21 02:41:30 tmp/example-500Mb/1384944751.119769/524288000/102400000/00000002 97M 2013-11-21 02:41:30 tmp/example-500Mb/1384944751.119769/524288000/102400000/00000003 97M 2013-11-21 02:41:30 tmp/example-500Mb/1384944751.119769/524288000/102400000/00000004 11M 2013-11-21 02:41:30 tmp/example-500Mb/1384944751.119769/524288000/102400000/00000005500M
- swift 命令行
- swift命令行操作
- Swift 命令行工具
- Swift 命令行工具
- 在命令行编译和调试Swift程序
- swift命令行上的编程-环境配置
- Swift命令行上的编程-参数测试
- Swift命令行上的编程-简单的webkit Browser
- IOS开发之Swift基础---输出命令行不换行!
- SWIFT
- swift
- Swift
- Swift
- swift
- Swift
- swift
- Swift
- swift
- fullcallender
- linux socket编程
- linux sed用法
- 通过 ulimit 改善系统性能
- VARIANT
- swift 命令行
- 解决Bitmap溢出的方法
- 昆仑通态触摸屏使用时注意事项
- MongoDB 聚合管道(一)(Aggregation Pipeline)
- HDU 1395 /ZOJ 1489
- 火车进栈
- git 笔记记录(三) 暂存区
- C++中cin、cin.get()、cin.getline()、getline()、gets()等函数的用法
- 初学者如何把握好算法和语言的关系