用于上传文件的Bash脚本

时间:2013-12-08 04:54:56

标签: bash

我在网上找到了这个脚本:

#!/bin/bash
HOST='your.ftp.site'
USER='remoteusername'
PASSWD='remotepasswd'

ftp -n -v $HOST << EOT
ascii
user $USER $PASSWD
prompt
//Stuff here
bye
EOT

(Source)

如何在//stuff here中选择文件/serverfiles.zip并将其放在外部FTP服务器上?

我试过谷歌,虽然我觉得这应该很容易但我找不到任何东西。

我正在使用debian 7 x64

1 个答案:

答案 0 :(得分:1)

mput /serverfiles.zip

应该有效。 从 ftp 手册页:

mput local-files
     Expand wild cards in the list of local files given as argu-
     ments and do a put for each file in the resulting list.  See
     glob for details of filename expansion.  Resulting file names
     will then be processed according to ntrans and nmap settings.