我试图让我的 ftp 日志包含我推送的命令以及会话进行时收到的输出。到目前为止我有以下内容:
/bin/echo '***** START OF FTP PROCESS *****'
/bin/echo $datetime_stamp
ftp -v -n << EOF >> $FTP_LOG_FILE
open $FTP_SERVER
user $USERNAME $PASSWORD
asc
prompt no
ls -al
cd $FTP_DIRECTORY
ls -al
quit
EOF
/bin/echo '***** END OF FTP PROCESS *****'
但是我的日志文件仅显示响应:
Connected to 10.125.0.122 (10.125.0.122).
220 Microsoft FTP Service
Remote system type is Windows_NT.
331 Password required
230 User logged in.
200 Type set to A.
Interactive mode off.
227 Entering Passive Mode (10,125,0,122,194,69).
125 Data connection already open; Transfer starting.
03-20-17 10:33AM <DIR> eMR_ABC
03-20-17 10:34AM <DIR> eMR_DEF
03-20-17 10:34AM <DIR> eMR_GHI
03-20-17 10:33AM <DIR> eMR_JKL
03-20-17 10:34AM <DIR> eMR_MNO
03-13-17 10:17AM <DIR> eMR_PQRS
03-20-17 10:33AM <DIR> eMR_TUV
226 Transfer complete.
250 CWD command successful.
227 Entering Passive Mode (10,125,0,122,194,70).
125 Data connection already open; Transfer starting.
226 Transfer complete.
221 Goodbye.
我希望它做的是显示在处理每个命令时输入的命令。
例如:
Connected to 10.125.0.122 (10.125.0.122).
220 Microsoft FTP Service
Remote system type is Windows_NT.
331 Password required
user XXXX YYYY
230 User logged in.
asc
200 Type set to A.
prompt no
Interactive mode off.
等等...有办法做到这一点吗?