可编写脚本的 Amazon S3 Windows 客户端?

可编写脚本的 Amazon S3 Windows 客户端?

快速提问,Windows 上 Amazon S3 的简单控制台客户端?

答案1

快速回答,查看s3 工具

答案2

Cloudberry 已编写 Powershell cmdlet,可能可以执行您要查找的操作:

http://www.cloudberrylab.com/default.aspx?page=amazon-s3-powershell

答案3

你没有说你用它做什么,但一种可能性是你想自动化某个过程,比如软件构建或备份。

如果你不介意编程(实际上只需要一点点),可以尝试博托,这是一个 Python 模块。我们在 Windows 上的构建脚本中使用它,这非常简单。您可以执行以下操作:

# Example: Upload an .exe file and make it world readable.
from boto.s3 import Connection
conn = Connection(YOUR_ACCESS_KEY_ID, YOUR_SECRET_ACCESS_KEY)
bucket = conn.get_bucket('some-bucket')
key = bucket.new_key('the_file.exe')
key.set_contents_from_filename('local_path_to_the_file.exe')
key.set_acl('public-read')

您还可以生成那些漂亮的自动过期 URL - 我们用于付费下载:

# Example: Get a URL for a file on S3. Make the URL expire after 1 day.
from boto.s3 import Connection
conn = Connection(YOUR_ACCESS_KEY_ID, YOUR_SECRET_ACCESS_KEY)
bucket = conn.get_bucket('some-bucket')
key = bucket.get_key('path/to/your/file')
url = key.generate_url(expires_in=86400)
# Note: 86400 is the number of seconds in 1 day

Python 有一个交互式命令行,因此也很容易进行实验。

答案4

你可以试试minio客户端又名“mc”。mc 提供最少的工具来与 Amazon S3 兼容的云存储和文件系统配合使用。

mc 实现了以下命令:

  ls        List files and folders.
  mb        Make a bucket or folder.
  cat       Display contents of a file.
  pipe      Write contents of stdin to one or more targets. When no target is specified, it writes to stdout.
  share     Generate URL for sharing.
  cp        Copy one or more objects to a target.
  mirror    Mirror folders recursively from a single source to many destinations.
  diff      Compute differences between two folders.
  rm        Remove file or bucket [WARNING: Use with care].
  access    Manage bucket access permissions.
  session   Manage saved sessions of cp and mirror operations.
  config    Manage configuration file.
  update    Check for a new software update.
  version   Print version.

mc <command> --help will provide example for working on individual commands. 

附言:我为这个项目做出了贡献,您的反馈和贡献将对我们有所帮助。

相关内容