2013-12-08 165 views
0

我發現這個腳本在線: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 64

回答

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.