Ftphost = "10.137.54.111"
Username = "bssftp"
Password = "123456"
Rpath = "/home/FTP/spuser/VAc/spsrvcapinfo/Request/all"
Bcsfile = "srvcapinfo _ *. areq"
CD/APP/interf/bin/hq2/hq2_prm/vaclocal/
For filename in 'LS-L $ {bcsfile} | awk '{print $9 }''
Do
CP $ filename/APP/interf/bin/hq2/hq2_prm/vacback/
Headstr = 'head-1 $ filename'
Headstrpre = $ (echo $ headstr | awk '{print substr ($, 23 )}')
Headstrend = $ (echo $ headstr | awk '{print substr ($, 79 )}')
Echo "$ {headstrpre} 104 $ {headstrend}"> "SP $ {filename }"
Rowcount = $ (cat <$ filename | WC-l)
Rowcount = 'expr $ rowcount-1'
Rowcount_str = 'printf "% 010d \ n" $ rowcount'
Tail-$ rowcount $ FILENAME> "SP $ {filename }"
Done
Echo "the province file is successfully generated based on the Headquarters business capability file"
CD/APP/interf/bin/hq2/hq2_prm/vaclocal/
For filename in 'LS-L $ {bcsfile} | awk '{print $9 }''
Do
Rm $ filename
Done
Echo "the Headquarters business capability file has been deleted"
Frm_upfile = "spsrvcapinfo _ *. areq"
For filename in 'LS-L $ {frm_upfile} | awk '{print $9 }''
Do
Echo $ filename
FTP-I-N $ ftphost <ftpit
User $ username $ Password
CD $ rpath
Bin
Put $ filename
Quit
Ftpit
MV $ filename/APP/interf/bin/hq2/hq2_prm/vacback/
Done
Echo "the business capability file is successfully transferred to the headquarters and backed up"