amazon-web-services - 如何从私有服务器 scp 到 Amazon s3?
问题描述
我需要将文件从服务器 A 复制到 S3。
约束:
- A 在专用网络中。
- A 只能是来自 B 的 ssh。
我尝试了什么:
scp -i key.pem user@ip:/path/to/file >(aws s3 cp - s3://s3/uri)
此命令仅在文件名为-
.
除了-
给出错误的任何名称:
The user-provided path file does not exist.
解决方案
对不起这是我的错。
我认为-
是源文件的名称。
因为当我尝试发送文件时,s3://s3/uri
它只复制了一个名为-
.
而是-
表示使用 bash 的进程替换传递给 aws cli 的标准输入<()
。
现在,通过在 qn 中更改我的 cmd 来复制文件,如下所示
scp -i key.pem user@ip:/path/to/file >(aws s3 cp - s3://s3/uri/filename)
:
推荐阅读
- c# - ASP CORE Identity 浏览器登录失败,但通过 UserManager.CheckPasswordAsync 与文字字符串工作
- spring - 春季批处理 HibernateCursorItemReaderBuilder 抛出 QuerySyntaxException
- c# - 从控制台读取空格后的变量
- java - 使用 xmlbeans、inst2xsd 和 Maven 从 XML 生成 XSD
- html - 我无法在 css 中设置任何 html/jsx 标记的样式,因为它说'h1“选择器”不是纯的'
- python - 如何将结果转换为列表-Python
- python - 从 3.5.4 传递到 3.6.8 时,如何解决 Python 正则表达式错误“错误错误转义 \m 在位置 37”
- java - 键盘打开时上移弹出窗口
- python - 变量不作为 Arg [python] 传递
- node.js - 如何在猫鼬中使父值可选,子值需要