简体   繁体   English

使用 python 或 node.js 将平面文件从 SFTP 上传到 S3

[英]uploading flat files from SFTP to S3 using python or node.js

I am getting some flat files every 15 minutes in SFTP server.我每 15 分钟在 SFTP 服务器中获取一些平面文件。 I want to know, how can i send these files to s3 bucket automatically using python or node.js program?我想知道,如何使用 python 或 node.js 程序将这些文件自动发送到 s3 存储桶? And if some python program runs, where should it run?如果某个 python 程序运行,它应该运行在哪里? Should there be any kind of job, which runs this program?是否应该有任何类型的工作来运行这个程序?

The simplest method would be to schedule a script to run on a regular basis on the server (using cron for Linux or a Scheduled Task for Windows).最简单的方法是安排一个脚本在服务器上定期运行(使用 cron Linux 或 Windows 的计划任务)。

The script can use the AWS Command-Line Interface (CLI) , which has a aws s3 cp command that can transfer files to Amazon S3.该脚本可以使用AWS Command-Line Interface (CLI) ,它有一个aws s3 cp命令可以将文件传输到 Amazon S3。

If you wish to use Python or Node instead, there are AWS SDKs available for those languages (and many more) that make it easy to transfer files to Amazon S3.如果您希望改用 Python 或 Node,可以使用适用于这些语言(以及更多语言)的AWS SDK ,可以轻松地将文件传输到 Amazon S3。

The server sending the files will also need AWS credentials to authorize the data transfer.发送文件的服务器还需要 AWS 凭证来授权数据传输。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM