分类

VBS/BAT脚本

Pubwin2009备份数据关闭重启电脑BAT

Pubwin2009备份数据关闭重启电脑BAT

大小:5 KB

语言:简体中文系统:Win2003, WinXP, Win2000, NT, WinME

类别:VBS/BAT脚本时间:2011-01-21

Pubwin2009备份数据关闭重启电脑BAT

@echo off
color 0A
title=自动备份数据库并重启电脑,且只保留最近五次备份t   080731-技术169
::/停止pubwin服务/
echo 正在停止PUBWIN服务...
net stop "Pubwin Application Server">nul
net stop "SQLSERVERAGENT">nul
net stop "MSSQLSERVER">nul
taskkill /F /IM ServiceManager.exe>nul
echo 正在备份数据库文件...
::/建立当前时间的备份目录/
Set dd=%date:~0,10%
Set tm1=%time:~0,2%
if /i %tm1% LSS 10 (set tm1=0%time:~1,1%)
Set tm2=%time:~3,2%
Set tt=%tm1%点%tm2%分
md "e:pubwin数据库备份%dd%_%tt%"
::/复制数据库到备份目录/
copy "%java_home%../../../database/" "e:pubwin数据库备份%dd%_%tt%"
::/只保留最近几次的备份文件
dir /o-d /b e:pubwin数据库备份>temp.txt
for /F "skip=5" %%a in (temp.txt) do @if exist e:pubwin数据库备份%%a rd /s /q e:pubwin数据库备份%%a
del temp.txt
::/重启电脑/
shutdown -s -t 1


∨ 展开

同类推荐

相关下载

猜你喜欢

热门推荐

下载排行

网友评论

我要跟帖
取消
所有评论 共 0