c:\script\auto_backup.bat,内容如下:
echo ========================================== >> c:\script\autoftp.log
cd c:\backup
del /q *
date /t >> c:\script\autoftp.log
time /t >> c:\script\autoftp.log
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_OrderBill.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_OrderBill.log tables=Portal_OrderBill direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_PORTAL_SHOPPING_GOODSLIST.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_PORTAL_SHOPPING_GOODSLIST.log tables=PORTAL_SHOPPING_GOODSLIST direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_bill_PayResponse.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_bill_PayResponse.log tables=Portal_bill_PayResponse direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_Consignee.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_Consignee.log tables=Portal_Consignee direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_Standard_Combination.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_Standard_Combination.log tables=Portal_Standard_Combination direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_PORTAL_customer_information.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_PORTAL_customer_information.log tables=PORTAL_customer_information direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_Invoice.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_Invoice.log tables=Portal_Invoice direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_prep_phonenumber.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_prep_phonenumber.log tables=Portal_prep_phonenumber direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_gifts.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_gifts.log tables=Portal_gifts direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_VA_OFFER_OrderBill.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_VA_OFFER_OrderBill.log tables=Portal_VA_OFFER_OrderBill direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_ProdOfferInfo_orderbill.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_ProdOfferInfo_orderbill.log tables=Portal_ProdOfferInfo_orderbill direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_SendSubRT_From_VSOP_ResultInfo.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_SendSubRT_From_VSOP_ResultInfo.log tables=SendSubRT_From_VSOP_ResultInfo direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_PayCard_Subscribe.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_PayCard_Subscribe.log tables=Portal_PayCard_Subscribe direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_portal_term_spec.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_portal_term_spec.log tables=portal_term_spec direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_PORTAL_PPM_PROD_OFFER.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_PORTAL_PPM_PROD_OFFER.log tables=PORTAL_PPM_PROD_OFFER direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_PORTAL_BANKCARDPAY_PRICE.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_PORTAL_BANKCARDPAY_PRICE.log tables=PORTAL_BANKCARDPAY_PRICE direct=y indexes=n statistics=none constraints=n
exp wt/qwertty~puzzles@mhzs file=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_PayCard.dmp log=c:\backup\%date:~2,4%%date:~7,2%%date:~10,2%_Portal_PayCard.log tables=Portal_PayCard direct=y indexes=n statistics=none constraints=n
ftp -n -s:"c:\script\bck.ftp" >> c:\script\autoftp.log
c:\script\bck.ftp,文件内容如下:
open 132.63.6.122
user nsftsp1 nsftfsstsp123
bin
prompt
cd /app/ftpdata/backup/
lcd c:\backup
type
mput *.dmp
bye
exit
小结:1,ftp -n -s:"c:\script\bck.ftp" >> c:\script\autoftp.log;使用ftp -n及-s禁用ftp交互
及使用指定的脚本文件,和exp的parfile一个道理.
2,c:\script\bck.ftp中的代码必须是lcd c:\backup, 而非lcd c:\backup\,如此备份始 终出错
3,\%date:~2,4%%date:~7,2%%date:~10,2%动态指定以日期生产每天的备份文件名,注意每个window的date显示格式不同,一定要测试
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-754788/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9240380/viewspace-754788/