1

アプリケーション サーバーのある場所からデータベース サーバーへの特定のファイルの転送を自動化する必要があるという要件があります。

これらの手順を使用して手動で実行できますが、スクリプトで必要です

#! /bin/ksh

directory path where the file need to be

ftp (hostname of the application server)

 username

 password

file location in the apps server

get filename

quit

どんな助けでも本当に感謝しています....

よろしくサム

4

2 に答える 2

0

Expectは、このようなシナリオをスクリプト化するための優れたツールです。

#!/usr/bin/expect -f 
spawn ftp ftp.ftpsite.com 
expect "ftp> " 
send -- "user MYUSER\r" 
expect "Password: " 
send -- "MYPASSWORD\r" 
expect "ftp> " 
send -- "cd /pub/test\r" 
expect "ftp> " 
send -- "put myfile\r" 
expect "File transfered" 
send -- "exit\r"
于 2013-09-20T14:09:08.513 に答える
0

あなたはそれを検索したかもしれません:

ftp -inv <<EOF
   open app.server.address
   user username password
   cd some/location
   get filename
   bye
EOF
于 2013-09-20T13:31:03.060 に答える