linux - Linux下执行FTP命令文件

标签 linux shell ftp

如标题所述,我想登录 ftp 服务器并使用 ftp 命令运行本地 FTP 命令文件,在一个将要执行的命令中通过 php。我过去曾这样做过,但使用 sftp 而不是使用 ftp

我想实现如下我为 sftp 所做的事情:

sftp -b commands.txt user@host

commands.txt 文件包含要在服务器中运行的 ftp 命令(例如 mget)

最佳答案

普通Linux ftp 没有提供脚本文件的选项。

但是你可以使用 standard input redirection相反:

ftp < commands.txt

关于linux - Linux下执行FTP命令文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51651346/

相关文章:

linux - unix下同步四个shell脚本依次运行

python - 在 python shell 中, "b"字母不起作用,什么?

file - 如何在grails中上传文件到远程FTP服务器

c - SIGCHLD 在 Linux 上通过 SIGCONT 发送,但在 macOS 上不发送

c - 使用全局变量的线程问题

linux - 线程 : some questions

ant ftp 不下载子目录中的文件

linux - 如何提高KVM VPS的网络性能

linux - 变量赋值退出shell脚本

PHP无法将电子邮件附件上传到ftp服务器