Shell連到FTP問題 - Linux

By Elizabeth
at 2011-10-16T06:51
at 2011-10-16T06:51
Table of Contents
請教一下各位高手們,
我寫了一隻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
--
Tags:
Linux
All Comments

By Connor
at 2011-10-21T03:44
at 2011-10-21T03:44

By Lucy
at 2011-10-23T20:26
at 2011-10-23T20:26

By James
at 2011-10-24T04:56
at 2011-10-24T04:56

By Poppy
at 2011-10-27T05:46
at 2011-10-27T05:46

By Candice
at 2011-10-29T08:56
at 2011-10-29T08:56

By Gilbert
at 2011-11-01T04:47
at 2011-11-01T04:47

By Harry
at 2011-11-02T23:03
at 2011-11-02T23:03

By Hedda
at 2011-11-04T09:44
at 2011-11-04T09:44

By Elvira
at 2011-11-09T00:29
at 2011-11-09T00:29
Related Posts
unity跟gnome3 我的體驗差距...

By Adele
at 2011-10-16T01:50
at 2011-10-16T01:50
更新到一半關機就出問題

By Daniel
at 2011-10-15T20:28
at 2011-10-15T20:28
請問Linux上有沒有類似cpanel的程式

By Agnes
at 2011-10-15T14:59
at 2011-10-15T14:59
請問版上有使用過xen這套軟體的前輩

By Jack
at 2011-10-15T02:23
at 2011-10-15T02:23
無法進入開機選單

By Ivy
at 2011-10-15T00:40
at 2011-10-15T00:40