Pubwin2009备份数据关闭重启电脑BAT
软件介绍人气软件相关文章网友评论下载地址
为您推荐:VBS/BAT脚本
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条