windows服务器维护经验小结(rsync,serv_u)

2019-10-25 11:54:39 织梦安装使用
  • 文章介绍
rsync 客户端执行同步操作的bat


@echo off
rsync -ztruvoglp --progress --password-file=jb51.secrets /cygdrive/g/wwwroot/jb51/ jb51@114.80.*.*::jb51


rsync 服务器端配置

rsyncd.conf

use chroot = false
strict modes = false
hosts allow = *
log file = rsyncd.log
pid file = rsyncd.pid

# Module definitions
# Remember cygwin naming conventions : c:work becomes /cygwin/c/work
#

bigdown
path = /cygdrive/f/webroot/bigdown
read only = false
transfer logging = yes
auto user=wtjb51
secrets file=wtjb51.conf


wtjb51.conf(客户端服务器端都要有)
服务器端是根目录,客户端是bin目录,大家多测试下,如果提示密码不对就可能是路径问题

wtjb51:www.jb51.net


rsync守卫进程bat

可以防止机房突然断电,导致rsync服务无法开启

@echo off
for /f "usebackq" %%i in (`"tasklist|find /c "cygrunsrv.exe""`) do (
set chkstat=%%i
)
if %chkstat% == 0 (
del "D:Program FilescwRsyncServer syncd.pid" /f
net start RsyncServer
echo ================ >> %date:~0,10%.log
echo %date% %time% check rsync service stop >> rsync%date:~0,10%.log
echo restart rsync service! >> %date:~0,10%.log
echo ================ >> %date:~0,10%.log
)



serv_u守卫进程(针对serv_u经常停止问题)bat


@echo off
for /f "usebackq" %%i in (`"tasklist|find /c "ServUDaemon.exe""`) do (
set chkstat=%%i
)
if %chkstat% == 0 (
net start Serv-U
echo ================ >> %date:~0,10%.log
echo %date% %time% check Serv-U service stop >> %date:~0,10%.log
echo restart Serv-U service! >> %date:~0,10%.log
echo ================ >> %date:~0,10%.log
)


sqlserver定时重启bat


echo y net stop SQLSERVERAGENT
echo y net stop mssqlserver
net start mssqlserver
net start SQLSERVERAGENT


sqlserver压缩日志

可以将jb51.ldf文件变得很小,方便备份数据库等,在sqlserver查询分析器中执行即可。

DUMP TRANSACTION jb51 WITH NO_LOG
BACKUP LOG jb51 WITH NO_LOG
DBCC SHRINKDATABASE(jb51)



服务器重启如果使用了rsync服务端,为了不让rsync服务器端无法启动
可以使用下面的bat


net stop RsyncServer
shutdown /r /f


或者在rsync服务端安装目录


del rsyncd.pid
C:WINDOWSsystem32shutdown.exe /r /f


seo模板网原创文章

上一篇:用DNSPod和Squid打造自己的CDN (六) ..

下一篇:windows上面安装squid加速代理网站配..

专业的织梦模板定制下载站,在线购买后即可下载!

商业源码

跟版网模板,累计帮助5000+客户企业成功建站,为草根创业提供助力!

立刻开启你的建站之旅

QQ在线客服

服务热线

织梦建站咨询