安装:
1 pip install s3cmd
配置:
1 s3cmd --configure
基础操作命令:
s3cmd -h
1 Commands: 2 Make bucket 3 s3cmd mb s3://BUCKET 4 Remove bucket 5 s3cmd rb s3://BUCKET 6 List objects or buckets 7 s3cmd ls [s3://BUCKET[/PREFIX]] 8 List all object in all buckets 9 s3cmd la 10 Put file into bucket 11 s3cmd put FILE [FILE...] s3://BUCKET[/PREFIX] 12 Get file from bucket 13 s3cmd get s3://BUCKET/OBJECT LOCAL_FILE 14 Delete file from bucket 15 s3cmd del s3://BUCKET/OBJECT 16 Delete file from bucket (alias for del) 17 s3cmd rm s3://BUCKET/OBJECT 18 Restore file from Glacier storage 19 s3cmd restore s3://BUCKET/OBJECT 20 Synchronize a directory tree to S3 (checks files freshness using size and md5 checksum, unless overridden by options, see below) 21 s3cmd sync LOCAL_DIR s3://BUCKET[/PREFIX] or s3://BUCKET[/PREFIX] LOCAL_DIR or s3://BUCKET[/PREFIX] s3://BUCKET[/PREFIX] 22 Disk usage by buckets 23 s3cmd du [s3://BUCKET[/PREFIX]] 24 Get various information about Buckets or Files 25 s3cmd info s3://BUCKET[/OBJECT] 26 Copy object 27 s3cmd cp s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2] 28 Modify object metadata 29 s3cmd modify s3://BUCKET1/OBJECT 30 Move object 31 s3cmd mv s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2] 32 Modify Access control list for Bucket or Files 33 s3cmd setacl s3://BUCKET[/OBJECT] 34 Modify Bucket Versioning 35 s3cmd setversioning s3://BUCKET enable|disable 36 Modify Bucket Object Ownership 37 s3cmd setownership s3://BUCKET BucketOwnerPreferred|BucketOwnerEnforced|ObjectWriter 38 Modify Block Public Access rules 39 s3cmd setblockpublicaccess s3://BUCKET BlockPublicAcls,IgnorePublicAcls,BlockPublicPolicy,RestrictPublicBuckets 40 Modify Object Legal Hold 41 s3cmd setobjectlegalhold STATUS s3://BUCKET/OBJECT 42 Modify Object Retention 43 s3cmd setobjectretention MODE RETAIN_UNTIL_DATE s3://BUCKET/OBJECT 44 Modify Bucket Policy 45 s3cmd setpolicy FILE s3://BUCKET 46 Delete Bucket Policy 47 s3cmd delpolicy s3://BUCKET 48 Modify Bucket CORS 49 s3cmd setcors FILE s3://BUCKET 50 Delete Bucket CORS 51 s3cmd delcors s3://BUCKET 52 Modify Bucket Requester Pays policy 53 s3cmd payer s3://BUCKET 54 Show multipart uploads 55 s3cmd multipart s3://BUCKET [Id] 56 Abort a multipart upload 57 s3cmd abortmp s3://BUCKET/OBJECT Id 58 List parts of a multipart upload 59 s3cmd listmp s3://BUCKET/OBJECT Id 60 Enable/disable bucket access logging 61 s3cmd accesslog s3://BUCKET 62 Sign arbitrary string using the secret key 63 s3cmd sign STRING-TO-SIGN 64 Sign an S3 URL to provide limited public access with expiry 65 s3cmd signurl s3://BUCKET/OBJECT <expiry_epoch|+expiry_offset> 66 Fix invalid file names in a bucket 67 s3cmd fixbucket s3://BUCKET[/PREFIX] 68 Modify tagging for Bucket or Files 69 s3cmd settagging s3://BUCKET[/OBJECT] "KEY=VALUE[&KEY=VALUE ...]" 70 Get tagging for Bucket or Files 71 s3cmd gettagging s3://BUCKET[/OBJECT] 72 Delete tagging for Bucket or Files 73 s3cmd deltagging s3://BUCKET[/OBJECT] 74 Create Website from bucket 75 s3cmd ws-create s3://BUCKET 76 Delete Website 77 s3cmd ws-delete s3://BUCKET 78 Info about Website 79 s3cmd ws-info s3://BUCKET 80 Set or delete expiration rule for the bucket 81 s3cmd expire s3://BUCKET 82 Upload a lifecycle policy for the bucket 83 s3cmd setlifecycle FILE s3://BUCKET 84 Get a lifecycle policy for the bucket 85 s3cmd getlifecycle s3://BUCKET 86 Remove a lifecycle policy for the bucket 87 s3cmd dellifecycle s3://BUCKET 88 Upload a notification policy for the bucket 89 s3cmd setnotification FILE s3://BUCKET 90 Get a notification policy for the bucket 91 s3cmd getnotification s3://BUCKET 92 Remove a notification policy for the bucket 93 s3cmd delnotification s3://BUCKET 94 List CloudFront distribution points 95 s3cmd cflist 96 Display CloudFront distribution point parameters 97 s3cmd cfinfo [cf://DIST_ID] 98 Create CloudFront distribution point 99 s3cmd cfcreate s3://BUCKET 100 Delete CloudFront distribution point 101 s3cmd cfdelete cf://DIST_ID 102 Change CloudFront distribution point parameters 103 s3cmd cfmodify cf://DIST_ID 104 Invalidate CloudFront objects 105 s3cmd cfinval s3://BUCKET/OBJECT [s3://BUCKET/OBJECT ...] 106 Display CloudFront invalidation request(s) status 107 s3cmd cfinvalinfo cf://DIST_ID[/INVAL_ID] 108 109 For more information, updates and news, visit the s3cmd website: 110 http://s3tools.org
标签:s3,BUCKET,OBJECT,bucket,Modify,s3cmd From: https://www.cnblogs.com/sunshine-blog/p/17916689.html