2009年12月18日 星期五

簡單ftp shell –(Linux)

參考網址:http://www.stratigery.com//scripting.ftp.html

範例: /usr/bin/fput.sh

#!/bin/sh
PATH=$PATH:/sbin:/bin:/usr/sbin/:/usr/bin
export PATH
FTPIP="10.0.0.1"
FTPUSER="guest"
FTPPWD="guest"
FTPPORT="21"
cho "Go to get files from" $FTPIP
ncftp  <<EOF
open -u $FTPUSER -p $FTPPWD -P $FTPPORT $FTPIP
binary
mput $1
bye
EOF

 

譬如要傳1.txt 從linux到10.0.0.1

就下指令

fput.sh 1.txt

 

:D

沒有留言:

 
Blogger Template Layout Design by [ METAMUSE ] : Code Name Gadget 1.1