亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区
Chinaunix
標(biāo)題:
FTP腳本求助
[打印本頁(yè)]
作者:
sea987
時(shí)間:
2013-08-27 00:16
標(biāo)題:
FTP腳本求助
大家好,情景:solaris終端機(jī)FTP到某一個(gè)網(wǎng)段10多臺(tái)solaris服務(wù)器上的相同目錄抓取2個(gè)文件,且每個(gè)服務(wù)器的這兩個(gè)文件名相同;需求:在終端機(jī)上自動(dòng)建立這10多臺(tái)服務(wù)器Hostname的文件夾,且將各自服務(wù)器文件ftp到對(duì)應(yīng)的目錄。請(qǐng)大家提供下思路,有現(xiàn)成腳本更好。謝謝大家!
作者:
rdcwayx
時(shí)間:
2013-08-27 06:45
本帖最后由 rdcwayx 于 2013-08-27 08:45 編輯
HOST='ftp.users.net'
USER='yourid'
PASSWD='yourpw'
FILE='file.txt'
for HOST in server1 server2 serverx ....
do
#FTP
ftp $HOST <<END_SCRIPT
user $USER
$PASSWD
put $FILE
quit
END_SCRIPT
done
復(fù)制代碼
作者:
donalds2008
時(shí)間:
2013-08-27 11:28
#!/bin/bash
usr="xx";#user
pwd="xx";#password
get_file="xx";#file
ip_file="ip.list"#server ip list
expect <<EOF
set timeout 3
set list_ip [open $ip_file r]
while {[gets \$list_ip ip ] != -1} {
exec mkdir \$ip
spawn ftp \$ip
expect "Name"
send "$usr\r"
expect "*ssword"
send "$pwd\r"
expect "ftp>"
send "cd dir\r"
expect "ftp>"
send "get $get_file \$ip/$get_file \r"
expect "ftp>"
send "quit\r"
}
expect eof
EOF
作者:
donalds2008
時(shí)間:
2013-08-27 11:28
#!/bin/bash
usr="xx";#user
pwd="xx";#password
get_file="xx";#file
ip_file="ip.list"#server ip list
expect <<EOF
set timeout 3
set list_ip [open $ip_file r]
while {[gets \$list_ip ip ] != -1} {
exec mkdir \$ip
spawn ftp \$ip
expect "Name"
send "$usr\r"
expect "*ssword"
send "$pwd\r"
expect "ftp>"
send "cd dir\r"
expect "ftp>"
send "get $get_file \$ip/$get_file \r"
expect "ftp>"
send "quit\r"
}
expect eof
EOF
復(fù)制代碼
作者:
秋天的絮兒
時(shí)間:
2013-08-27 15:55
ftp -niv <<END
open HOST
user xxx xxxx
binary y
lcd /xxxx
put xxx.txt
close
END
ftp -niv <<END
open HOST
user xxx xxxx
binary y
lcd /xxxx
put xxx.txt
close
END
...........................
復(fù)制代碼
歡迎光臨 Chinaunix (http://www.72891.cn/)
Powered by Discuz! X3.2