[問題] Shell連到FTP問題
請教一下各位高手們,
我寫了一隻shell去登入到ftp然後上傳
請參考一下原始檔,並看一下紅色的部份
主要是這兩行的關係問題,
我下了一個備份的指令,產生一個檔名為F502_今天的日期Ymd 例F502_20111016
然後連到ftp去上傳這個檔案,我試過用date同樣的寫法,但似乎在ftp上面不支援
請問在ftp上面有什麼寫法可以符合我的需求呢?
#!/usr/bin/expect
spawn ssh 10.0.252.2
expect "Pass*"
send "password"
expect "*root*"
send "b config save F502_`date +%Y%m%d`\n"
send "cd /var/local/ucs/\n"
send "ftp 10.0.115.100\n"
expect "*Name*"
send "itnoc\n"
expect "*word*"
send "Welcome1\n"
expect "ftp>"
send "put F502_20111016.ucs\n"
send "exit\n"
send "exit\n"
expect eof
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.211.34.185
→
10/16 07:05, , 1F
10/16 07:05, 1F
→
10/16 07:06, , 2F
10/16 07:06, 2F
推
10/16 07:46, , 3F
10/16 07:46, 3F
→
10/17 05:27, , 4F
10/17 05:27, 4F
→
10/17 05:27, , 5F
10/17 05:27, 5F
→
10/17 09:38, , 6F
10/17 09:38, 6F
→
10/18 05:06, , 7F
10/18 05:06, 7F
→
10/18 05:07, , 8F
10/18 05:07, 8F
→
10/18 05:08, , 9F
10/18 05:08, 9F
→
10/18 05:10, , 10F
10/18 05:10, 10F
討論串 (同標題文章)