windows备份示例

rem echo off
color 0a

rem Version:backup_was V1.0,had tested on windows 2003
rem FUNTION:use rar compress the D:\ErpDataLog& D:\images
rem IP:10.8.252.23, <ErpDataLog&images>

set PATH=%PATH%;D:\tomcat_bacth
set BATCH=D:\BATCH
set BACKUP=D:\backup\Server3
set ErpDataLog_images_WAR=D:\ErpDataLog&D:\images

rem hh=8:00--> 08:00
set CurTime=%time%
set hh=%CurTime:~0,2%

rem 时间戳 年月日时分秒
set FILE_DATE=%date:~0,4%%date:~5,2%%date:~8,2%

rar a -m5 %BACKUP%\images%FILE_DATE%.rar D:\web\images
sleep 3
rar a -m5 %BACKUP%\online%FILE_DATE%.rar D:\web\online
sleep 3
rar a -m5 %BACKUP%\wwwroot%FILE_DATE%.rar C:\inetpub\wwwroot
sleep 3
copy *%FILE_DATE%*.rar \\10.8.252.251\Server3\

rem delete 7days ago 
forfiles /p D:\backup\Server3 /m *.log -d -7 /c "cmd /c del /f @path"
forfiles /p D:\backup\Server3 /m *.rar -d -7 /c "cmd /c del /f @path"

echo local_batch.bat OK,storage_backup.bat begin.
rem pause
call storage_backup.bat

  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值