简体   繁体   English

如何使用Shell脚本将文件从Amazon EFS复制到我的本地计算机?

[英]How to copy files from Amazon EFS to my local machine with shell script?

I have a question regarding file transfer from Amazon efs to my local machine with a simple shell script. 我有一个关于使用简单的shell脚本将文件从Amazon efs传输到本地计算机的问题。 The manual procedure I follow is: 我遵循的手动过程是:

  • Copy the file from efs to my Amazon ec2 instance using sudo cp 使用sudo cp将文件从efs复制到我的Amazon ec2实例
  • Copy from ec2 to my local machine using scp or FileZilla (drag and drop) 使用scp或FileZilla从ec2复制到我的本地计算机(拖放)

Is there a way it can be done running a shell script in which I give two inputs: source file address and save destination directory? 有没有一种方法可以运行一个运行Shell脚本的方法,在该脚本中我提供两个输入:源文件地址和保存目标目录?

Can two steps be reduced to one ie directly copying from efs to local machine? 是否可以将两个步骤简化为一个步骤,即直接从efs复制到本地计算机?

You should be able to mount to the local machine and access the remote file system locally on your machine. 您应该能够安装到本地计算机上并在本地计算机上访问远程文件系统。

http://docs.aws.amazon.com/efs/latest/ug/mounting-fs.html http://docs.aws.amazon.com/efs/latest/ug/mounting-fs.html

With mounting, you can access the file locally with your machine resources to edit the remote files. 安装后,您可以使用计算机资源在本地访问文件以编辑远程文件。

While SCP can work, you need to keep them in sync all the time between your local and remote. 在SCP可以工作的同时,您需要使它们始终在本地和远程之间保持同步。

Hope it helps. 希望能帮助到你。

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

相关问题 如何通过扩展名将文件从本地计算机复制到Docker容器? - How to copy files by extension from Local Machine to Docker Container? 仅在Shell脚本中将文件复制到我的USB - Copy files to my usb ONLY in shell script 如何将整个文件夹从 Amazon EC2 Linux 实例复制到本地 Linux 机器? - How to copy entire folder from Amazon EC2 Linux instance to local Linux machine? 从shell脚本,如何复制整个文件树 - From a shell script, how to copy entire tree of files 我该如何计划一个脚本,使用CRON和SCP每小时使用时间戳将文件从远程服务器复制到本地计算机? - How can I schedule a script to copy a file from a remote server to my local machine every hour with a time stamp using CRON & SCP? Shell脚本复制文件 - Shell script to copy files 如何使用 shell 脚本将最新文件从 sftp 复制到本地目录? - How to copy latest file from sftp to local directory using shell script? 如何在我的下面的shell脚本中使用rsync而不是scp来复制文件? - How to use rsync instead of scp in my below shell script to copy the files? Shell ftp希望将文件从本地智能复制到ftp服务器 - shell ftp expect to intelligently copy files from local to ftp server 如何将远程Windows上的文件复制到Linux计算机上的本地Linux? - How to copy files on remote Windows to local Linux on a Linux machine?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM