Windows Server Maintenance Experience Summary (RSYNC,SERV_U) _win server

Source: Internet
Author: User
Tags sql server query mssqlserver rsync
BAT for rsync clients to perform synchronous operations

Copy Code code as follows:

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


rsync server-side configuration

Rsyncd.conf
Copy Code code as follows:

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 (available on client server side)
Server-side is the root directory, the client is the bin directory, everyone more testing, if the hint password is wrong may be the path problem
Copy Code code as follows:

Wtjb51:www.jb51.net


rsync Guard Process Bat

Can prevent the engine room suddenly power off, cause the rsync service cannot open
Copy Code code as follows:

@echo off
for/f "Usebackq"%%i in (' "Tasklist|find/c" Cygrunsrv.exe "") Does (
Set chkstat=%%i
)
If%chkstat% = 0 (
Del "D:\Program Files\cwrsyncserver\rsyncd.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 Guard Process (for Serv_u frequently stop problem) bat

Copy Code code as follows:

@echo off
for/f "Usebackq"%%i in (' "Tasklist|find/c" ServUDaemon.exe "") Does (
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
)


SQL Server timed reboot bat

Copy Code code as follows:

Echo y net stop SQLServerAgent
echo y net stop mssqlserver
NET start MSSQLServer
Net start SQLServerAgent


SQL Server compressed log

You can make jb51.ldf files very small, make it easy to back up databases, and so on, and execute them in SQL Server Query Analyzer.
Copy Code code as follows:

DUMP TRANSACTION [jb51] with no_log
BACKUP LOG [jb51] with no_log
DBCC shrinkdatabase ([jb51])



Server reboot If you are using the Rsync server, in order not to allow Rsync servers to start
You can use the following bat

Copy Code code as follows:

net stop Rsyncserver
SHUTDOWN/R/F


or install the directory on the rsync server

Copy Code code as follows:

Del Rsyncd.pid
C:\WINDOWS\SYSTEM32\SHUTDOWN.EXE/R/F


Cloud Habitat Community Original article
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.