ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 在window 上实现每日定时备份一期订单并ftp的脚本

在window 上实现每日定时备份一期订单并ftp的脚本

原创 Linux操作系统 作者:wisdomone1 时间:2013-02-26 22:50:19 0 删除 编辑

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博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-754788/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
提供针对oracle初学者及进阶的数据库培训,欢迎大家咨询: 微信: wisdomone 微信公众号: lovedb 工作经历: 中国普天 北京科蓝 北京云和恩墨 北京神州新桥

注册时间:2008-04-04

  • 博文量
    2189
  • 访问量
    12686016