請教一下各位高手們,
我寫了一隻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
--
我寫了一隻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
--
All Comments