bat 备份文件,上传文件

文件1:

ftp  -n  -s:"upload.txt"
call upload_bankup_rename.bat

文件2:upload.txt

Open 192.168.1.1
User username password
Cd /as3t/exp_imp/C162/scrap
Bin
Prompt
mput E:escraptesttransfer.csv
mput E:escraptestadjust.csv
bye

文件3:upload_bankup_rename.bat

rem 获取当前日期和时间
set bak_date=%date:~0,4%%date:~5,2%%date:~8,2%
set bak_time=%time:~0,8%
set bak_time=%bak_time::=%
cd E:escraptest
rem 重命名备份至另外的文件夹
IF EXIST transfer.csv Ren transfer.csv  %bak_date%_%bak_time%_transfer_local.csv
xcopy %bak_date%_%bak_time%_transfer_local.csv E:escrapbatbankup_
del %bak_date%_%bak_time%_transfer_local.csv
IF EXIST adjust.csv Ren adjust.csv  %bak_date%_%bak_time%_adjust_local.csv
xcopy %bak_date%_%bak_time%_adjust_local.csv E:escrapbatbankup_
del %bak_date%_%bak_time%_adjust_local.csv