我想lftp -c一次性完成整个会话(因为我稍后会从脚本中启动它)并且我成功了,-e但是那个 ofc 给我留下了我不想要的交互式会话。
手动状态
-c commands
Execute the given commands and exit. Commands can be separated with a semicolon, `&&'
or `||'. Remember to quote the commands argument properly in the shell. This option
must be used alone without other arguments.
Run Code Online (Sandbox Code Playgroud)
但我不明白我应该如何正确引用和串接我的命令/交互。
lftp -e "put -O remote/dir/ /local/file.txt" -u user,pass ftpsite.com
效果很好。但是我想在执行命令后退出;
lftp -c "open -u user,pass ftpsite.com" || put -O "remote/dir/ /local/file.txt"
只是对我大喊大叫,或者实际上我尝试过的任何引号组合(||或&&不管)
gle*_*man 43
$ lftp -c "open -u user,pass ftpsite.com; put -O remote/dir/ /local/file.txt"
Run Code Online (Sandbox Code Playgroud)
应该这样做。
如果这不起作用,请尝试添加/etc/lftp.conf以下行:
set ftp:ssl-protect-data true
set ftp:ssl-force true
set ftp:ssl-auth TLS
set ssl:verify-certificate no
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
104889 次 |
| 最近记录: |